program triple_dots
  implicit none
  integer :: k, n
  character(100) :: s
  read(*,*) k
  read(*,*) s
  n = len_trim(s)
  if (n > k) then
    write(*,'(a)') s(1:k)//'...'
  else
    write(*,'(a)') s(1:n)
  end if
end program triple_dots