program main
integer :: k
character*100 ::s

read(*,*)k
read(*,*)s
if (len_trim(s) <= k) then
write(*,*) s
else
do i = (len_trim(s) - k),len_trim(s)
s(i:i) = ''
end do
write(*,*)s//'...'
end if
end program