Problem:
 Score: 200 points    Problem Statement  We have a string S consisting of lowercase English letters.  If the length of S is at most K , print S without change.  If the length of S exceeds K , extract the first K characters in S , append ... to the end of them, and print the result.      Constraints   K is an integer between 1 and 100 (inclusive).  S is a string consisting of lowercase English letters.  The length of S is between 1 and 100 (inclusive).         Input  Input is given from Standard Input in the following format:  K  S       Output  Print a string as stated in Problem Statement.        Sample Input 1 7
nikoandsolstice      Sample Output 1 nikoand...  nikoandsolstice has a length of 15 , which exceeds K=7 .  We should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand... .       Sample Input 2 40
ferelibenterhominesidquodvoluntcredunt      Sample Output 2 ferelibenterhominesidquodvoluntcredunt  The famous quote from Gaius Julius Caesar.

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x,'b') 
def to_oct(x: int) -> str: return format(x,'o') 
def to_hex(x: int) -> str: return format(x,'x') 
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(n=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(n+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, n+1, i): is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]
def prime_factor(n):
    """Return a list of prime factorization numbers of n"""
    res = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0: res.append(i); n //= i
    if n != 1: res.append(n)
    return res

MOD=10**9+7

import itertools as it
import functools as ft
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left

def main():
    k = II()
    s = IS()
    n = len(s)
    if n > k:
        print(s[:k]+'...')
    else:
        print(s)

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
s=input()
      

if len(s)>n:
    print(s[:n]+"...")
    
else:
    print(s)

Solution (Python):
num = int(input())
string = input()

if num < len(string):
    string = string[0:num] + '...'

print(string)

Solution (Python):
K = int(input())
S = input()

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

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  k=I()
  s=S()

  n=len(s)
  if n<=k:
    return s
  return s[:k]+'...'


print(main())

Solution (Python):
k=int(input())
s=input()
if k < len(s):
    print(s[:k]+'...')
else:
    print(s)

Solution (Python):
k= int(input())
s = input()

if len(s) < k+1:
  print(s)
else:
  print(s[:k] + "...")

Solution (Python):
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...')

Solution (Python):
K = int(input())
S = str(input())

s = len(S)

if s <= K:
    print(S)
else:
    print(S[:K] + "...")

Solution (Python):
def B():
    K = int(input())
    S = input()
    if len(S) > K:
        print(S[:K]+'...')
    else:
        print(S)
    
B()

Solution (Python):
a = int(input())
b = input()
i = 0
while i < a and i < len(b):
    print(end = b[i])
    i = i + 1
if a < len(b) :
    print(end = "...")

Solution (Python):

k = int(input())

s = input()

'''
k = 40
s = 'ferelibenterhominesidquodvoluntcredunt'

'''
nagasa = len(s)

if nagasa <= k:
    print(s)
elif nagasa > k:
    print(s[ :k] + '...')

Solution (Python):
K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  S_ = S[0:K]
  print(S_+'...')

Solution (Python):
k = int(input())
s = input()
if len(s) <= k:
    print(s)
else:
    print(s[:k],'...',sep='')

Solution (Python):
K = int(input())
S = list(input())
S1 = []
L = len(S)

if(K >= L):
    print(''.join(S))
else :
    S.insert(K,'.')
    S.insert(K+1,'.')
    S.insert(K+2,'.')
    print(''.join(S[0:K+3]))

Solution (Python):
n = int(input())
str = input()
print(str) if len(str) <= n else print(str[:n] + '...')

Solution (Python):
length = input()
length = int(length)

moji = input()
moji = str(moji)

if len(moji) <= length:
  print(moji)
else:
  print(moji[:length] + '...')

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

Solution (Python):
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...')

Solution (Python):
K = int(input())
S = input()
tail_str = ''
if K < len(S):
    tail_str = '...'
print('%s%s' % (S[:K], tail_str))

Solution (Python):
k=int(input())
s = input()

if len(s) > k:
    print(s[:k]+'...')
else:
    print(s)

Solution (Python):
K = int(input())
S = input()
if K == len(S) or K > len(S): print (S)
else:
    print (S[:K]+'...')

Solution (Python):
K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  print(S[:K]+'...')

Solution (Python):
k = int(input())
s = list(input())

if len(s) > k:
    s = s[:k]
    s.append("...")
print("".join(s))

Solution (Python):
K = int(input())
S = list(input())
len_S = int(len(S))
S1 = ' '

if len_S <= K:
  for x in S:
    S1 += x
  print(S1)
else:
  del S[K:]
  for x in S:
    S1 += x
  print(S1 + '...')

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

Solution (Python):
K = int(input())
S = input()


if len(S) <= K:
    print(S)
else:
    s =""
    for i in range(K):
        s = s + S[i]

    s = s + "..."
    print(s)

Solution (Python):
k = int(input())
s = input()

if len(s) <= k:
    print(s)
else:
    r = ''.join(s[:k])
    print(r + "...")

Solution (Python):
k = int(input())
s = str(input())
e = int(len(s))

if k < e:
  print(s[0:k]+'.'*3)
else:
  print(s)

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

Solution (Python):
k = input()
s = input()
if(len(s) <= int(k)):
  print(s)
else:
  print(s[:int(k)]+'...')

Solution (Python):
K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    a = len(S) - K
    print(S[:-a]+'...')

Solution (Python):
k=input()
s=input()
k=int(k)
if len(s)>k:
    print(s[:k]+"...")
else:
    print(s)

Solution (Python):
N = int(input())
s = input()
s = s.lower()
ls = []
if len(s) <= N:
    print(s)
else:
    c = s[:N] +"..."
    print(c)

Solution (Python):
a = int(input())
b = input()
if len(b) <= a:
    print(b)
else:
    print(b[:a]+"...")

Solution (Python):
K=int(input())
S=input()


if len(S)<=K:
    print(S)

else:
    print(S[0:K]+"...")

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

Solution (Python):
K = int(input())
S = str(input())

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

Solution (Python):
K = int(input())
S = list(input())

if len(S) <= K:
    print(''.join(S))
else:
    b = ''.join(S[0:K])
    print(b + "...")

Solution (Python):
K = int(input())
S0 = str(input())
S = list(S0)

if len(S) <= K:
    print(S0)
else:
    print(S0[:-(len(S)-K)] + '...')

Solution (Python):
K=int(input())
S=input()
if (K>=len(S)):
    print (S)
else:
    print ((S[0:(K)]) + "...")

Solution (Python):
K = input()
S = input()
ans =""
if len(str(S)) <= int(K):
    print(S)
else:
    for i in range(int(K)):
        ans += S[i]
    print(str(ans) + "...")

Solution (Python):
Kkk = int(input())  
String = str(input())
res=""
if len(String)>Kkk :
   for i in range (0,len(String)):
    if i<=Kkk-1:
      res=res+String[i]
   print(res+("..."))
else : 
  print(String)

Solution (Python):
k = int(input())
s = input()

if len(s) <= k: print(s)
else:
    print(s[:k] + '...')

Solution (Python):
k = int(input())
s = input()
print(s if len(s)<=k else s[:k]+'...')

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

Solution (Python):
Kkk = int(input())  
String = str(input())
res=""
if len(String)>Kkk :
   for i in range (0,len(String)):
    if i<=Kkk-1:
      res=res+String[i]
   print(res+("..."))
else : 
  print(String)

Solution (Python):
K = input()
S = input()
if len(S) <= int(K):
  print(S)
else:
  print(S[:int(K)] + '...')

Solution (Python):
n = int(input())
s = input()
if len(s)<=n: print(s)
elif len(s)>n: print(s[0:n]+'...')

Solution (Python):



def main():
    k = int(input())
    S = list(input())
    if len(S) <= k:
        print(''.join(S))
    else:
        print(f'{"".join(S[:k])}...')


if __name__ == "__main__":
    main()

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

Solution (Python):
k = int(input())
s = input()
l = len(s)

if l <= k:
    print(s)
else:
    print(f'{s[:k]}...')

Solution (Python):
n = int(input())
s = input()

if len(s) <= n:
    print(s)
else:
    print(s[:n]+"...")

Solution (Python):
K = int(input())
S = input()
string = ""

if len(S) <= K:
    print(S)
else:
    for i in range(K):
        string += S[i]
    print(string + "...")

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

Solution (Python):
n = int(input())
s = input()

if (len(s) <= n):
    print(s)
else:
    print(s[:n] + '...')

Solution (Python):
K = int(input())
S = input()
if len(S) > K:
    print(S[:K]+'...')
else:
    print(S)

Solution (Python):
K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  print(S[:K] + '...')

Solution (Python):
k=int(input())
s=list(input())
if len(s) > k:
  del s[k:]
  s.append('...')
  map = map(str, s)
  print(''.join(map))
else:
  map = map(str, s)
  print(''.join(map))

Solution (Python):
n = int(input())
s = input()
a = len(s)
if a <= n:
  print(s)
else:
  print(s[0:n] + '...')

Solution (Python):
k = int(input())
s = input()
if k >= len(s):
    print(s)
else:
    print(s[:k]+'...')

Solution (Python):
k = int(input())
s = input()
s_len = len(s)

if s_len <= k:
    print(s)
else:
    i = 0
    s_list = list(s)
    result = []
    while i < k:
        result.append(s_list[i])
        i += 1
    print(''.join(result) + "...")

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

Solution (Python):
k=int(input())
s=input()
if len(s)<=k:
    print(s)
else:
    l=list(s)
    s=l[0:k]
    s.append('...')
    print(''.join(s))

Solution (Python):
k=int(input())
s=input()
if(len(s)<=k):
    print(s)
elif(len(s)>k):
    for i in range(k):
        print(s[i],end="")
    print('...',end="")

Solution (Python):
if __name__ == "__main__":
    K = int(input())
    S = input()
    if len(S) <= K:
        print(S)
    else:
        print(S[:K]+"...")

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

Solution (Python):
k=int(input())
s=input()

if len(s)<=k:
  print(s)
else:
  print(s[:k]+'...')

Solution (Python):
n = int(input())
s = input()

if len(s) <= n:
    print(s)
else:
    print(s[:n]+'...')

Solution (Python):
K=int(input())
S=str(input())

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

Solution (Python):
def main():
  k = int(input())
  s = input()
  
  if len(s) <= k:
    print(s)
  else:
    print(s[:k] + '...')
  
  
if __name__ == '__main__':
  main()

Solution (Python):
import sys

k = int(input())
s = str(input())

if k < len(s):
  for i in range(k):
    sys.stdout.write(s[i])
  
  sys.stdout.write('...')
else:
  for i in range(len(s)):
    sys.stdout.write(s[i])

Solution (Python):
K = int(input())
S = input()

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

Solution (Python):
FAST_IO = 0
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())


def solve(K,S):
    if len(S) <= K: return S
    return S[:K] + '...'
print solve(rri(), rr())

Solution (Python):
K = int(input())
S = input()
if len(S) <= K:
    print(S)
elif len(S)>K:
    print(S[:K] + '...')

Solution (Python):
k=int(input())
s=input()

print(s[:k]+'...' if len(s)>k else s)

Solution (Python):
K = int(input())
S = input()
Sl = len(S)
if Sl <= K:
  ans = S
else:
  newS = S[0 : K]
  ans = (newS + "...")
print(ans)

Solution (Python):
k = int(input())
s = input()

if(len(s) > k):
  ss = s[0:k] + '...'
  print(ss)
else:
  print(s)

Solution (Python):
k = int(input())
s = input()
if len(s) > k:
  print(s[:k]+'...')
else:
  print(s)

Solution (Python):
K=int(input())
S=str(input())
import sys
s=''
for i in range(K):
    try:
        s+=S[i]
    except IndexError:
        print (s)
        sys.exit()
if s==S:
    print (s)
else:
    s=s+'...'
    print (s)

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))

def resolve():
    K=int(input())
    S=input()
    s=len(S)
    if s>K:
        a=S[:K]
        print(a+"...")
    else:print(S)

resolve()

Solution (Python):
K = input()
S = input()

Knum = int(K)
Slength = len(S)

if Slength <= Knum:
	str = S
else:
	str = S[0:Knum] + "..."

print(str)

Solution (Python):
K=int(input())
S=input()

if len(S)<=K:
    print(S)
else:
    print(S[:K]+'...')

Solution (Python):
k = int(input())
s = input()

ls = len(s)

if ls <= k:
    print(s)

else:
    print(s[:k] + "...")

Solution (Python):
def main():
  K = list(map(int,input().split()))[0]
  S = list(map(str,input().split()))[0]
  if K >= len(S):
    ans = S
  else:
    ans = S[0:K] + '...' 

  return ans
if __name__ == '__main__':
  print(main())

Solution (Python):
K = int(input())
S = input()

if K >= int(len(S)):
  print(S)
else:
  print(S[0:K]+'...')

Solution (Python):
K = int(input())
S = input()
if len(S) > K:
    print(S[0:K]+"...")
else:
    print(S)

Solution (Python):
k = int(input())
s = input()

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

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve():
    k = II()
    s = list(S())
    if len(s) > k:
        print("".join(s[:k]) + "...")
    else:
        print("".join(s))
    return



if __name__ == '__main__':
    solve()

Solution (Python):
K = int(input())
S = input()
s_len = len(S)
if s_len <= K:
    print(S)
else:
    chars = list(S)
    ans = ""
    for i in range(K):
        ans += chars[i]
    ans += "..."
    print(ans)

Solution (Python):
s = [input() for i in range(2)] 
s0 = int(s[0])
l0=len(s[1])
if s0 >= l0:
    print(s[1])
if s0 < l0:
    print(s[1][:s0]+'...')

Solution (Python):
k = int(input())
s = str(input())
if k>=len(s):
  print(s)
else:
  a = s[0:k]+'...'
  print(a)

Solution (Python):
K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  print(S[:K]+'...')

Solution (Python):
K=int(input())
S=input()
if K<len(S):
    print(S[0:K]+'...')
else:
    print(S)

Solution (Python):
k = int(input())
n = input()

if(k < len(n)):
    print(n[:k]+"...")
else:
    print(n)

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

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

Solution (Python):
K = int(input())
S = str(input())
if len(S)>K:
    print(S[0:K] +"...")
else:
    print(S)

Solution (Python):
K = int(input())
S = input()
n = int(len(S))
if n <= K:
  print(S)
else:
  print(S[:K] + "...")

Solution (Python):
k = int(input())
s = str(input())
s_num=len(s)
if(s_num<=k):
  print(s)
else:
  print(s[:k]+"...")

Solution (Python):
k=int(input())
s=input()
n=0
result=''
if len(s)<=k:
    print(s)
else:
    for i in s:
        result+=i
        k-=1
        if k==0:
            print(result+'...')

Solution (Python):
k=int(input())
s=input()

if len(s) <= k:
  print(s)

else:
  print(s[:k]+"...")

Solution (Python):


def solve(k: int, s: str) -> str:
    if len(s) <= k:
        return s
    else:
        return s[:k] + '...'


def main():
    K = int(input())
    S = input()
    zzy = solve(K, S)
    print(zzy)

if __name__ == '__main__':
    main()

Solution (Python):
k = int(input())
s = input()

if len(s) <= k:
    print(s)
else:
    print(s[0:k] + '...')

Solution (Python):

import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  

'''

def factorial(x, mod=10**9+7):
    
    
    
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''











'''
ascii_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
digits = '0123456789'
hexdigits = '0123456789abcdefABCDEF'
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...\xaf\xb0...
lowercase = 'abcdefghijklmnopqrstuvwxyz'
octdigits = '01234567'
printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU...
punctuation = '!"
uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
whitespace = '\t\n\x0b\x0c\r '
'''
def main():
    n=3
    steps=0
    state=0
    w=1
    j=0
    k=0
    
    n=int(input())
    
    
    
    
    s=input()
    a=[i for i in s]
    
    
    


    for i in range(1,n+1,2):
     pass
     

    l = ['aaa', 'bbb', 'ccc']
    x=l.index('aaa')
    if len(s)>n:
     s = ''.join(a[:n])+'...'
     print(s)
     sys.exit()
    print(s)
    
    
    

    
        
    
    

    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    
        
        
    
    
        
        
    


    
    



    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]
    

    ls = ["a", "b", "c", "d", "e"]


    
    

    
    

    
    
    
    
    
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Solution (Python):
K = int(input())
S = str(input())
s = int(len(S))
if s <= K:
    print(S)
else:
    print(S[0:K] + '...')

Solution (Python):
k = int(input())
s = input()

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

Solution (Python):
K = int(input())
S = input()

if K >= len(S):
  print(S)
else:
  print(f'{S[:K]}...')

Solution (Python):
k=int(input())
s=input()
char=[]
if len(s) <= k:
    print(s)
elif len(s) > k:
    for i in range(k):
        char.append((s[i]))
    print(''.join(char) + "...")

Solution (Python):
a=int(input())
s=list(input())
if a>=len(s):
  for i in range(len(s)):
      print(s[i],end='')
else:
  del s[a:]
  s.append('...')
  for i in range(len(s)):
      print(s[i],end='')

Solution (Python):
K = int(input())
S = input()

s_len = len(S)

if s_len <= K:
    print(S)

else:
    print(S[:K]+"...")

Solution (Python):
import sys
import os

k = int(input())
s = input()
s2 = s[:k]

if s == s2:
    print(s2)
else:
    print(s2 + "...")

sys.exit()

Solution (Python):
k=int(input())
s=list(input())
if len(s)<=k:
  print(str(''.join(s)))
else:
  print(str(''.join(s[:k]))+'...')

Solution (Python):
k=int(input())
s=input()
if len(s)<=k:
    print(s)
else:
    s=s[:k]
    s+='...'
    print(s)

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

Solution (Python):
K=int(input())
S=input()

if len(S)<=K:
    print(S)
else:
    S=S[:K]+'...'
    print(S)

Solution (Python):
import sys
si = sys.stdin.readline


def main():
    k = int(si())
    s = si()[:-1]
    if len(s) > k:
        print(s[:k]+'...')
    else:
        print(s)

if __name__ == '__main__':
    main()

Solution (Python):
k=int(input())
s=input()

if (len(s) <= k):
  print(s)
else:
  print(s[:k]+'...')

Solution (Python):
K = input()
S = str(input())
if len(S)<=int(K):
    print(S)
if len(S)>int(K):
    K = int(K)
    S = str(S[0:K])+ "..."
    print(S)

Solution (Python):
K=int(input())
S=input()
if len(S) > K:
	S = S[:K]+"..."
print(S)

Solution (Python):
n=int(input())
a=input()
if len(a)<=n:
    print(a)
else:
    print(a[:n]+'...')

Solution (Python):
k=int(input())
s=input()
l=len(s)
if l>k:
  ex=s[0:k]
  print(ex+"...")
else:
  print(s)

Solution (Python):
K = int(input())
S = input()

if K >= len(S):
    print(S)
    exit()

print("{}...".format(S[0:K]))

Solution (Python):
k = input()
s = input()
k = int(k)
s_len = len(s)
out = ''

if s_len <= k:
  print(s)
else:
  for i in range(k):
    out += s[i]
  print(out+'...')

Solution (Python):
def main():
  k = int(input())
  str = input()
  lenOfStr=len(str)
  if (lenOfStr <= k):
  	print(str[0:k])
  else:
  	print(str[0:k] + "...")
if __name__ == "__main__":
    main()

Solution (Python):
K = int(input())
S = input()

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

Solution (Python):
a = [(input()) for i in range(2)]

K = int(a[0])
S = a[1]

if 1 <= K <= 100 and 1 <= len(S) <= 100:
  if len(S) <= K:
    print(S)
  else:
    print(S[0:K]+'...')

Solution (Python):
k = int(input())
s = input()
if len(s) > k:
    print(f'{s[:k]}...')
else:
    print(s)

Solution (Python):
K = int(input())
S = str(input())

if K < len(S):
    print(S[0:K] + '...')
else:
    print(S)

Solution (Python):
k = int(input())
s = input()
l = len(s)
if l<=k:
    print(s)
else:
    print(s[:k] + '...')

Solution (Python):
def main():
  K = int(input())
  S = input()
  if len(S) <= K:
    print(S)
  else:
    print(S[:K]+"...")

if __name__ == "__main__":
    main()

Solution (Python):
K = int(input())
S = input()

if len(S) > K:

    for i in range(0,K):

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

    print("...")

else:

    print(S)

Solution (Python):
K = int(input())
S = input()

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

Solution (Python):
k=int(input())
s=input()

if(len(s)<=k):
    print(s)
else:
    print(s[:k]+'...')

Solution (Python):
N=int(input())
S=input()
if len(S)>N:
    print(S[0:N]+"...")
elif len(S)<=N:
    print(S)

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

Solution (Python):
a=int(input())
b=input()
if len(b)>a:
    
    print(b[:a]+'...')
else:
    print(b)

Solution (Python):
K = int(input())
S = input()

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

Solution (Python):
number=int(input())
word=input()
length=len(word)
if length<=number:
  print(word)
if length>number:
  word=word[0:number]
  print(word+"...")

Solution (Python):
K = int(input())
S = str(input())

if len(S) <= K :
    print(S)
else:
    print(S[0:K]+'...')

Solution (Python):
K = int(input())
T = input()
S = list(T)

if len(S) <= K:
    print(T)
else:
    A = ''.join(S[:K])
    print(A, '...', sep='')

Solution (Python):
k = int(input())
s = input()

if len(s) <= k:
	print(s)
else:
    print(s[:k]+'...')

Solution (Python):
k=int(input())
s=input()
if len(s)>k:
    print(s[0:k]+"...")
else:
    print(s)

Solution (Python):
length=int(input())
a=input()

if len(a)<=length:
  print(a)
else:
  print(a[:length] + "...")

Solution (Python):
K=int(input())
S=input()
S1=S[:K]
if len(S)<=K:
	print(S)
else:
	print(S1+"...")

Solution (Python):

import sys
import itertools

DEBUG = True if (len(sys.argv) > 1 and sys.argv[1] == "DEBUG") else False


def dp(value):
    if DEBUG:
        print(value)
    return


def input_text(split=" "):
    
    result = []
    while True:
        try:
            row = list(
                map(lambda x: int(x) if x.isdecimal() else x, input().split(split))
            )
            result.append(row)
        except EOFError:
            break
    return result



it = input_text()
k = it[0][0]
s = it[1][0]

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

Solution (Python):
K=int(input())
S=input()
W=(S[:K])
if W==S:
    print(S)
else:
    print(W+"...")

Solution (Python):
K,S=int(input()),input()
if len(S)<=K: print(S)
else:print(S[:K]+'...')

Solution (Python):
K = int(input())
S = input()

if len(S) <= K:
  print(S)
else:
  S_part = S[0:K] + str("...")
  print(S_part)

Solution (Python):
n = int(input())
s = input()

if len(s) <= n:
  print(s)
else:
  print(s[:n] + '...')

Solution (Python):
K = int(input())
S = input()
if len(S) <= K:
    print(S)
else:
    print(str(S[:K]) + '...')

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

Solution (Python):
k = int(input())
s = input()

if k < len(s):
  print("{}...".format(s[0:k]))
else:
  print(s)

Solution (Python):
k = int(input())
s = input()
l = len(s)
if k >= l:
  print(s)
if k < l:
  print(s[0:k]+"...",end='')

Solution (Python):
K = int(input())
S = str(input().lower())
if K-5 < len(S) <= K:
    print(S)
else:
    print(S[:K] + '...')

Solution (Python):
K = int(input())
S = input()
s = list(S)
ns = len(S)
if ns <= K:
    print(S)
elif ns > K:
    while ns > K:
        s.pop(-1)
        ns -= 1
    s += ['...']
    print(''.join(s))

Solution (Python):
n = int(input())
a = input()
if len(a) > n:
  print(a[0:n]+'...')
else:
  print(a )

Solution (Python):
k = int(input())
s = input()
n = len(s)

if n <= k:
    print(s)
else:
    s = s[0:k] + "." * 3
    print(s)

Solution (Python):
K = int(input())
S = input()

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

Solution (Python):
import sys 

a = [(input()) for i in range(2)]

target_length = int(a[0])
target_word = str(a[1])

if len(target_word) > target_length:
    print(target_word[0:target_length]+"...")
elif len(target_word) <= int(a[0]):
    print(target_word)

Solution (Python):
k = int(input())
s = list(input())

print("".join(s[:k]) + ("..." if len(s) > k else ""))

Solution (Python):
k = input()
s = input()
if len(s)<=int(k):
    print(s)
else:
    print(s[0:int(k)]+'...')

Solution (Python):
k = int(input())
s = input()
print(s if len(s) <= k else (s[:k] + '...'))

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

Solution (Python):
N = int(input())
S = input()

if len(S) <= N:
    print(S)
else:
    print(S[:N] + "...")

Solution (Python):
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + "." * 3)

Solution (Python):
K = int(input())
S = str(input())
if len(S) <= K:
    print(S)
else:
    print('{}...'.format(S[0:K]))

Solution (Python):
k=int(input())
s=input()
if len(s)>k:
	print(s[0:k]+'...')
else:
	print(s)

Solution (Python):
K = int(input())
S = input()
if len(S)>K:
    print(S[:K]+"...")
else:
    print(S)