K = int(eval(input()))

for i in range(1):

    S = eval(input())



if len(S) <= K:

    print(S)

else:

    print((S[0 : K] + '...'))

K = int(eval(input()))

S = eval(input())



if len(S) <= K:

    print(S)

else:

    print((S[0 : K] + '...'))

K = int(eval(input()))
for i in range(1):
    S = eval(input())
if len(S) <= K:
    print(S)
else:
    print((S[0:K] + "..."))

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

-for i in range(1): -    S = eval(input()) +S = eval(input())