N=int(input())

S=list(input())

if len(S)<=N:

   for i in range(len(S)):

       print(S[i],end="")

else:

    for i in range(N):

        print(S[i],end="")

    print("...")

k=int(input())

s=input()

if len(s)<=k:

    print(s)

else:

    for i in range(k):

        print(s[i],end="")

    print("...",end="")

N = int(input())
S = list(input())
if len(S) <= N:
    for i in range(len(S)):
        print(S[i], end="")
else:
    for i in range(N):
        print(S[i], end="")
    print("...")

k = int(input())
s = input()
if len(s) <= k:
    print(s)
else:
    for i in range(k):
        print(s[i], end="")
    print("...", end="")

-N = int(input()) -S = list(input()) -if len(S) <= N: -    for i in range(len(S)): -        print(S[i], end="") +k = int(input()) +s = input() +if len(s) <= k: +    print(s) -    for i in range(N): -        print(S[i], end="") -    print("...") +    for i in range(k): +        print(s[i], end="") +    print("...", end="")