K = int(eval(input()))

S = eval(input())



S_length = len(S)



if S_length <= K:

  print(S)

else:

  print((S[0:K] + '...'))  
k = int(eval(input()))

s = eval(input())



if len(s) <= k:

  print(s)

else:

  print((s[:k] + '...'))

K = int(eval(input()))
S = eval(input())
S_length = len(S)
if S_length <= K:
    print(S)
else:
    print((S[0:K] + "..."))

k = int(eval(input()))
s = eval(input())
if len(s) <= k:
    print(s)
else:
    print((s[:k] + "..."))

-K = int(eval(input())) -S = eval(input()) -S_length = len(S) -if S_length <= K: -    print(S) +k = int(eval(input())) +s = eval(input()) +if len(s) <= k: +    print(s) -    print((S[0:K] + "...")) +    print((s[:k] + "..."))