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.



Sample input:
7
nikoandsolstice


Sample output:
nikoand...

Submission status: Accepted

Solution code:
k = int(input())
s = str(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    str_length = input()
    input_str = input()

    str_length = int(str_length)

    if len(input_str) <= str_length:
        lim_str = input_str
    else:
        lim_str = ''.join([c for c in input_str[0:str_length]])+'...'



    print(lim_str)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=int(input())
S=input()
if len(S)<= K:
    print(S)
else:
    S_list=list(S)
    T_list=S_list[0:K]
    T_list.append("...")
    print(''.join(T_list))

Submission status: Accepted

Solution code:
k = int(input())
s = input()
w = len(s)
if w <= k:
    print(s)
else:
    ans = s[0:k]
    print('%s...' % ans)

Submission status: Accepted

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


length = len(S)

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

Submission status: Accepted

Solution code:
import sys
import math
def get_array(): return list(map(int,sys.stdin.readline().strip().split()))
def get_ints(): return map(int,sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
k=int(input())
s=input()
a=[]
p=""
if len(s)<=k:
    print(s)
else:
    for i in range(k):
        a.append(s[i])
    a.append("...")
    print(p.join(a))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

K = int(input())
S = str(input())

if len(S)<=K:
    print("{}".format(S))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
a=list(s)
if k >= len(s):
    print(s)
    exit()
for i in range(k):
    print(a[i],end='')
print('...')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(n,base=2):
    rt=[]
    for tb in range(base**n):s=[tb//(base**bt)%base for bt in range(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
 
YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()
 
class Tree:
    def __init__(self,inp_size=None,ls=None,init=True,index=0):
        self.LCA_init_stat=False
        self.ETtable=[]
        if init:
            if ls==None:
                self.stdin(inp_size,index=index)
            else:
                self.size=len(ls)+1
                self.edges,_=GI(self.size,self.size-1,ls,index=index)
        return
 
    def stdin(self,inp_size=None,index=1):
        if inp_size==None:
            self.size=int(input())
        else:
            self.size=inp_size
        self.edges,_=GI(self.size,self.size-1,index=index)
        return
    
    def listin(self,ls,index=0):
        self.size=len(ls)+1
        self.edges,_=GI(self.size,self.size-1,ls,index=index)
        return
 
    def __str__(self):
        return  str(self.edges)
 
    def dfs(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append(x)
        v=[-1]*self.size
        v[x]=root_v
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==-1:
                    q.append(nb)
                    v[nb]=func(v[c],nb,d)
        return v
 
    def EulerTour(self,x):
        q=deque()
        q.append(x)
        self.depth=[None]*self.size
        self.depth[x]=0
        self.ETtable=[]
        self.ETdepth=[]
        self.ETin=[-1]*self.size
        self.ETout=[-1]*self.size
        cnt=0
        while q:
            c=q.pop()
            if c<0:
                ce=~c
            else:
                ce=c
                for nb,d in self.edges[ce]:
                    if self.depth[nb]==None:
                        q.append(~ce)
                        q.append(nb)
                        self.depth[nb]=self.depth[ce]+1
            self.ETtable.append(ce)
            self.ETdepth.append(self.depth[ce])
            if self.ETin[ce]==-1:
                self.ETin[ce]=cnt
            else:
                self.ETout[ce]=cnt
            cnt+=1
        return
    
    def LCA_init(self,root):
        self.EulerTour(root)
        self.st=SparseTable(self.ETdepth,init_func=min,init_idl=inf)
        self.LCA_init_stat=True
        return
    
    def LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            self.LCA_init(root)
        xin,xout=self.ETin[x],self.ETout[x]
        yin,yout=self.ETin[y],self.ETout[y]
        a=min(xin,yin)
        b=max(xout,yout,xin,yin)
        id_of_min_dep_in_et=self.st.query_id(a,b+1)
        return self.ETtable[id_of_min_dep_in_et]
 
class SparseTable: # O(N log N) for init, O(1) for query(l,r)
    def __init__(self,ls,init_func=min,init_idl=float('inf')):
        self.func=init_func
        self.idl=init_idl
        self.size=len(ls)
        self.N0=self.size.bit_length()
        self.table=[ls[:]]
        self.index=[list(range(self.size))]
        self.lg=[0]*(self.size+1)
        
        for i in range(2,self.size+1):
            self.lg[i]=self.lg[i>>1]+1
 
        for i in range(self.N0):
            tmp=[self.func(self.table[i][j],self.table[i][min(j+(1<<i),self.size-1)]) for j in range(self.size)]
            tmp_id=[self.index[i][j] if self.table[i][j]==self.func(self.table[i][j],self.table[i][min(j+(1<<i),self.size-1)]) else self.index[i][min(j+(1<<i),self.size-1)] for j in range(self.size)]
            self.table+=[tmp]
            self.index+=[tmp_id]
    
    # return func of [l,r)
    def query(self,l,r):
        if r>self.size:r=self.size
        #N=(r-l).bit_length()-1
        N=self.lg[r-l]
        return self.func(self.table[N][l],self.table[N][max(0,r-(1<<N))])
    
    # return index of which val[i] = func of v among [l,r)
    def query_id(self,l,r):
        if r>self.size:r=self.size
        #N=(r-l).bit_length()-1
        N=self.lg[r-l]
        a,b=self.index[N][l],self.index[N][max(0,r-(1<<N))]
        if self.table[0][a]==self.func(self.table[N][l],self.table[N][max(0,r-(1<<N))]):
            b=a
        return b
    
    def __str__(self):
        return str(self.table[0])
 
    def print(self):
        for i in self.table:
            print(*i)
 
class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]
 
    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo
 
show_flg=False
show_flg=True
ans=0

k=I()
s=input()
ans=s
if len(s)>k:
    ans=ans[:k]+'...'

print(ans)

Submission status: Accepted

Solution code:
n= int(input())
L = list(input())

if n>=len(L):
	print(''.join(L))
else:
	print(''.join(L[:n])+'...')

Submission status: Accepted

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

S_len = len(S)

if K >= S_len:
    print(S)
else:
    print(S[0:K] + "...")

Submission status: Accepted

Solution code:
K = int(input())
Sm = input()
S = list(Sm)
#print(S)
sl = len(Sm)

if sl > K:
    print("".join(S[:K]) + "...")
else:
    print(Sm)

Submission status: Accepted

Solution code:
[K] = input().split()
K = int(K)
[S] = input().split()

if len(S) > K:
    S = S[:K] + '...'

print(S)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k=int(input())
s=str(input())

if (len(s)<=k):
    print(s)
else:
    s2=""
    for i in range(0,k):
        s2+=str(s[i])
    s2=str(s2)
    s2=s2+"..."
    print(s2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(S) <= int(K):
    print(S)
else:
    print("{}...".format(S[:int(K)]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cnt = int(input())

input_line = input()


if len(input_line) > cnt :
	print(input_line[:cnt] + "...")

else :
	print(input_line)

Submission status: Accepted

Solution code:
N = int(input())
a = input()

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

Submission status: Accepted

Solution code:
k = int(input())

s = str(input())

n = len(s)

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

Submission status: Accepted

Solution code:
s=[input() for i in range(2)]
K = int(s[0])
S = str(s[1])

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

Submission status: Accepted

Solution code:
k = int(input());
s = input();
n = int(len(s));
a = '...'

if k >= n:
    print(s);
else:
    print(s[:k] + a);

Submission status: Accepted

Solution code:

class abc_168:
    
    def __init__(self):
        pass
    
    def A(self):
       N=int(input())
       hon=[2,4,5,7,9]
       pon=[0,1,6,8]
       bon=[3]
       
       ans=N%100
       ans=ans%10
       
       if ans in hon:print("hon")
       elif ans in pon:print("pon")
       else :print("bon")
    
    def B(self):
        K=int(input())
        S=input()
        
        if len(S)<=K:print(S)
        else:
            ans=S[0:K]+"..."
            print(ans)
        
    def C(self):
       pass
            
    def D(self):
        pass
        
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_168()
    obj.B()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(str)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
s = list(map(str,input()))
j = len(s)
cnt = []

if j <= k:
    print("".join(s))
else:
    for i in range(k):
        i = s[i]
        cnt.append(i)
    print("".join(cnt)+"...")

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
st_t = input('')
st_t = str(st_t)
if(len(st_t) > n):
    print(st_t[:n] + '...')
else:
    print(st_t)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n <= k:
    print(s)
else:
    print(s[0:k], end="")
    print("...")

Submission status: Accepted

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

Submission status: Accepted

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

K = min(len(S), K)
for i in range(K):
    print(S[i], end='')

print('...' if K < len(S) else '')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
s = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def sol():
  k=int(input())
  s=input()
  if len(s)>k:
    return s[:k]+'...'
  return s

print(sol())

Submission status: Accepted

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

Submission status: Accepted

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

if len(S) <= K:
    print(S)
else:
    print('{}{}'.format(S[0:K], '...'))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
if len(s) <= n:
  print(s)
else:
  print(s[:n]+"...")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    K = int(input())
    S = input()
    if K >= len(list(S)):
        print(S)
    else:
        print(S[:K], end='')
        print("...")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
k = int(input())
s = input()

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
n=0
result=''
if k < len(s):
    while n<k:
        result+=s[n]
        n+=1
    result+='...'
else:
    result=s
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! /usr/bin python3
K = int(input())
S = input()

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

Submission status: Accepted

Solution code:
K = int(input())
S = input().strip()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
S = input()
s = list(S)

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

Submission status: Accepted

Solution code:
k = int(input())

str_list=list(input())


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = [input() for i in range(0, 2, 1)]
K_num = int(s[0])
S = s[1]
if K_num >= len(S):
    print(S)
else:
    print(S[:K_num]+"...")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  k = int(input())
  s = str(input())
  w = len(s)
  
  if w<=k:
    print(s)
  else:
    print(s[:k] + '...')
    
main()

Submission status: Accepted

Solution code:
number = int(input())
word    = input()
answer  =""

if number < len(word):
    answer = word[:number] + "..."
    print(answer)
else:
    print(word)

Submission status: Accepted

Solution code:
k = int(input())
s = str(input())
if len(s) > k:
  s = s[0:k]
  s += '...'

print(s)

Submission status: Accepted

Solution code:
size = int(input())
string = input()
if(len(string) <= size):
  print(string)
else:
  print(string[:size] + '...')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
s = str(input())

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

Submission status: Accepted

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

N=len(S)

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

Submission status: Accepted

Solution code:
k=int(input())
S=list(input())
if len(S)<=k:
  print("".join(S))
else:
  print("".join(S[0:k]),end="")
  print("...")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K=int(input())
S=input()
Slist=list(S)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys


def input():
    return sys.stdin.readline()


def resolve():
    k = int(input())
    s = input().rstrip()

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
k=int(input())
s=input()
t=len(list(s))
#print(t)
n=""
if(t<=k):
    print(s)
else:
    for i in range(k):
        n=n+s[i]
    n=n+"..."
    print(n)

Submission status: Accepted

Solution code:
K = int(input())
S = input()
SLen = len(S)
if SLen <= K:
    print(S)
else:
    print("{}..." .format(S[0:K]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-*- utf-8 -*-

k = int(input())
s = list(input())

rslt = ""

for index in range(k):
    if len(s) <= index:
        break
    rslt += s[index]

if len(s) > k:
    rslt += "..."

print(rslt, flush=True)

Submission status: Accepted

Solution code:
K = int(input())
S = input()
A = []

if len(S) <= K:
    print(S)
else:
    for i in range(0, K):
        A.append(S[i])
    s = ''.join(A)
    print(s + '...')

Submission status: Accepted

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

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

Submission status: Accepted

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

ls = len(s)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

#------------------------------warmup----------------------------
import os
import sys
from io import BytesIO, IOBase
import math 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
#-------------------game starts now----------------------------------------------------
# n,q=map(int,input().split())
# l=list(map(int,input().split()))
k=(int)(input())
n=(input())
# print(len(n))
if(k>=len(n)):
    print(n)
else:
    print(n[0:k],end='')
    print('...')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

lines = sys.stdin.readlines()
a = int(lines[0].strip())
b = lines[1].strip()

if a >= len(b):
  print(b)
else:
  print(''.join(list(b)[:a])+'...')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
s = str(input())
len_s = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def actual(k, s):
    if len(s) > k:
        return f'{s[:k]}...'

    return s

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

print(actual(k, s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
s=str(input())

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

else:
    c=s[0:k]+ '...'
    print(c)

Submission status: Accepted

Solution code:
k = int( input() )
s = str( input() )
#print( k, s )

l = len( s )
#print( l )

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

Submission status: Accepted

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

S = list(S)
out = []
flag = 0
for i in range(K):
    if i >= len(S):
        flag = 1
        break
    out.append(S[i])


if (i+1 != len(S)) and flag == 0:
    out.append('...')

print(''.join(out))

Submission status: Accepted

Solution code:
k=int(input())

s=input()

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

#標準出力からの読み込み

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

output = ''

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

print(output)

Submission status: Accepted

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

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

Submission status: Accepted

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

palavra = list(s)

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

else:
    x = len(palavra)
    while x > k:
        del palavra[x-1]
        x -= 1
    palavra.append("...")
    print("".join(palavra))

Submission status: Accepted

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

len = len(S)

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

Submission status: Accepted

Solution code:

K = int(input())
S = input()

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

Submission status: Accepted

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

if k >= len(s):
    print("".join(s))
else:
    for i in range(len(s)):
        if i == k:
            s[i] = "..."
        elif i > k:
            s[i] = ""
    print("".join(s))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
if len(s)<=k:print(s)
else:print(s[:k],end="...")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
l = list(S)

if len(l) > K:
    print(''.join(l[:K])+"...")
    
else :
    print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s=int(len(S))

if K>=s:
    print(S)
else:
    for i in range (K):
        print(S[i],end='')
    print('...')

Submission status: Accepted

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

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