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:
def main():
  if 'get_ipython' in globals(): 
    ##SAMPLE INPUT
    k = 7
    s = "nikoandsolstice"

  else:
    #import sys
    #sys.setrecursionlimit(100000)
    #input=lambda :sys.stdin.readline().rstrip()

    #INF=float("inf")
    #MOD=10**9+7

    ##INPUT 
    #n = input()
    k = int(input())
    s = input()

  ##SUBMITION CODES HERE
  if len(s) <= k:
    print(s)
  else:
    print(s[:k]+"...")
    
main()

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:
def main():
  if 'get_ipython' not in globals(): 
    #INPUT 
    k = int(input())
    s = input()

  else:
    #SAMPLE INPUT
    k = 7
    s = "nikoandsolstice"

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

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=input()
if len(s)>n:
    nl=s[0:n]
    print(nl+'...')
else:
    print(s)

Submission status: Accepted

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

# print(len(s))

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

else:
  for i in range(k):
    print(s[i], end='')

  print('...')

  # print('文字の長さは ' + str(len(s)) )
  # print('表示する文字数は ' + str(k) )

Submission status: Accepted

Solution code:
k = int(input())
s = input().lower()
dots = '...'

if len(s) > k:
    print(f'{s[:k]}{dots}')
else: print(s)

Submission status: Accepted

Solution code:
# coding: utf-8

a = int(input())
b = input()
if len(b) > a:
  print(str(b[:a]) + "...") 
else:
  print(b)

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 = input()
S = input()
Slen = len(S)
K = int(K)
if Slen <= K :
    print(S)
else :
    print(S[:K]+'...')

Submission status: Accepted

Solution code:
K = int(input())
S = list(input())
if len(S) <= K:
    for j in range(len(S)):
        print(S[j], end = '')
else:
    for i in range(K):
        print(S[i], end = '')
    print('...')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
a=input()
if len(a)>k:
    print(a[:k]+'...')
else:
    print(a)

Submission status: Accepted

Solution code:
def main():
    num = int(K)
    if num >= len(S):
        print(S)
    else:
        print(S[:num]+'...')

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

main()

Submission status: Accepted

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

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

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:
# S の長さが K 以下であれば、 S をそのまま出力してください。 
# S の長さが K を上回っているならば、先頭 K 文字だけを切り出し、末尾に ... を付加して出力してください。

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

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

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)
else:
  print("{}...".format(s[0:k]))

Submission status: Accepted

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

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(S[:K]+'...')

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    K = ii()
    S = iss()

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


if __name__ == '__main__':
    main()

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 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[:k]+'...')

Submission status: Accepted

Solution code:
N=int(input())
A=input()
# print(A)
B=len(A)
if N>=B:
    print(A)
else:
    for i in range(N):
        print(A[i],end="")
    print("...")

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:
    print (s[:k] + '...')

Submission status: Accepted

Solution code:
'''
問題文
S: 文字列，英小文字
条件１（長さK以下）→Sをそのまま出力
条件２（長さK以上）→先頭K文字+'...'を出力

アルゴリズム
1. Sの文字数を取得(len(S))
2. Sの文字数とKを比較
2-a. if(len(S)<=K)Sを出力
2-b. if(len(S)>K)先頭K文字+'...'を出力，for文を使って先頭K文字の配列を作り直して'...'を結合し出力．

'''

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

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

Submission status: Accepted

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

  ans = S

  if(len(S) > K):
    ans = S[0:K] + "..."

  print(ans)

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem Triple Dots

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

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

Submission status: Accepted

Solution code:
maxNum = int(input())
sentence = input()
if maxNum >= len(sentence):
  print(sentence)
else:
  print(sentence[:maxNum] + '...')

Submission status: Accepted

Solution code:
try:
  k=int(input())
  s=input()
  if(len(s)<=k):
    print(s)
  else:
    ans=''
    ans=s[:k]+'...'
    print(ans)
except EOFError as e:
  pass

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()
L = len(S)
T = S[:K]
T += "..."

if L <= K:
    print(S)
else:
    print(T)

Submission status: Accepted

Solution code:
num = int(input())
word = str(input())

if len(word) <= num:
    print(word)
else:
    word_r = word[:num] + '...'
    print(word_r)

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 len(S) > K:
  S = S[:K] + '...'
print(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()

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:
n=int(input())
s=input()
if len(s)>n:
  print(s[:n]+"...")
else:
  print(s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 16:59:03 2020

@author: Tofu
"""

def tran(N,string):
    #print(N)
    #print(string)
    if len(string) > N:
        strout = string[:N]+'...'
        return strout
    else:
        return string

if __name__ == '__main__':
    N = int(input())
    string = input()
    ans = tran(N,string)
    print(ans)

Submission status: Accepted

Solution code:
num = int(input())
script = input()

if(num >=len(script)):
    print(script)
else:
    print(script[0:num]+'...')

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
K = int(input())
S = input()

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

print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    length = int(input())
    moji = input()
    if(len(moji) > length):
        print(moji[0:length] + "...")
    else:
        print(moji)

resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
word = (input())

#print(len(word))
if len(word) > num:
  for i in range(num):
    print(word[i], end = "")
  print("...")
else:
  print(word)

Submission status: Accepted

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

l=len(S)
if l<=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: 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:
K = int(input())
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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
rep=range
def Golf():n,*t=map(int,open(0).read().split())
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 RA():return map(int,open(0).read().split())
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 accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
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)
read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
input=lambda: sys.stdin.readline().rstrip()


show_flg=False
show_flg=True
ans=0


#n,m=LI()
k=n=I()
s=input()

for i in range(n):
    0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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() #英小文字からなる文字列S

length_S = len(S)

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

Submission status: Accepted

Solution code:
k = int(input())
s = input()
print( s if len(s) <= k else s[: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 = []
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 K >= len(S):
  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[: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 = str(input())
if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...')

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
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 list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    k = I()
    s = S()
    if len(s) > k:
        return s[:k] + "..."

    return s

print(main())

Submission status: Accepted

Solution code:
#ABC168

n = int(input())
s = input()

s_length = len(s)

if s_length <= n:
    print(s)

else:
    print(s[0:n] + '...')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(K: int, S: str):
    if len(S) <= K:
        return S
    else:
        return S[:K] + '...'


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    print(solve(K, S))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
print(S) if len(S) <= K else print(S[: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:
limit = int(input())
string = input()

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

print(string)

Submission status: Accepted

Solution code:
K=int(input())
if K>=1 and K<=100:
    S=input()
    S_len=len(S)
    if S.islower() and S_len>=1 and S_len<=100:
        if S_len<=K: print(S)
        else: print(str(S)[:K] + "...")              
    else: print("Sは文字数が1以上100以下であり、全て小文字である必要があります")
else: print("Kは1以上100以下の整数")

Submission status: Accepted

Solution code:
def cut_string(S,K):
    if len(S) > K:
        return S[:K] + "..."
    return S

K = int(input())
S = input()
print(cut_string(S,K))

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:
n = int(input())
s = input()
if n >= len(s):
  print(s)
else:
  print(s[:n]+"...")

Submission status: Accepted

Solution code:
K = int(input())
S = input()
if len(S) > K:
  print(S[:K], '...', sep='')
else:
  print(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()
if len(s) > k:
    print(s[0:k] + "...")
else:
    print(s)

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:

import sys, os, re
from pprint import pprint

k = int(sys.stdin.readline().strip())
s = sys.stdin.readline().strip()

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 = input()
if len(S)<=K:
	print(S)
elif len(S)>K:
	print(S[:K]+"...")

Submission status: Accepted

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

Submission status: Accepted

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

if 0 < K < 101 and 0 < len(S) < 101:
    if len(S) <= K:
        print(S)
    else:
        print(S[:K] + "...") 
else:
    print("Try again with K and length of S between 1 and 100 ")

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:
k = int(input())
s = str(input())
l = len(s)

if k < l:
  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[0: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()

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

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[0:k]+"...")
else:
  print(s)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
if sys.version_info[0]<3: input=raw_input

class StandardInput:

    def stdin_string(self):
        self.s=str(input().rstrip())
        return self.s

    def stdin_integer(self):
        self.n=int(input().rstrip())
        return self.n

    def stdin_array(self):
        self.arr=input().rstrip().split()
        return self.arr

    def stdin_integer_array(self):
        self.arr=list(map(int,input().rstrip().split()))
        return self.arr

def test(k,s):
    if len(s) > k:
        return s[:k]+'...'
    else:
        return s

def main():
    obj=StandardInput()
    k=obj.stdin_integer()
    s=obj.stdin_string()
    print(test(k,s))
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
K = int(input())
S = input()
for i ,s in enumerate(S):
  if i == K:
    print('...')
    break
  print(s, end='')

Submission status: Accepted

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

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[:k]+'...')
else:
    print(s)

Submission status: Accepted

Solution code:
K=int(input())
S=input();
i=0;
if(K<len(S)):
    for ch in S:
        print(ch,end="")
        i+=1
        if(i>=K):
            break
    print("...")
else:
    print(S)

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 int(len(s)) <= k:
  print(s)
else:
  s=s[:k] + "..."
  print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
s = input()
print(('{}...'.format(s[:k]), s)[k >= len(s)])

Submission status: Accepted

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

if len(s)<=n:
    print(s)
else:
    i=0
    for i in range(n):
        print(s[i], end='')
    print('...')

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[:k] + "...")

Submission status: Accepted

Solution code:
# AtCoder
n = int(input())
s = input()

if len(s) > n:
    print(f'{s[:n]}...')
else:
    print(s)

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = input()
s = input()
length = len(s)
# print(k)
# print(s)
# print(length)

k = int(k)
if length <= k:
    print(s)
else:
    string = ''
    for i in range(k):
        string += s[i]
    string += '...'
    print(string)

Submission status: Accepted

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

if k >= len(s):
    print(s)
    exit(0)

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

Submission status: Accepted

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

if len(S) < K + 1:
    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:
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:
	ans=''
	for n in range(k):
		ans+=s[n]
	print(ans+'...')

Submission status: Accepted

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

print(S[:K] + '...' if len(S) > K else 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:
#-*-coding:utf-8-*-
k = int(input())
s = input()
s_len = len(s)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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='...')

Submission status: Accepted

Solution code:
v = int(input())
s = input()
s_len = len(s)

if s_len > v:
  print(s[:v] + "...")
else:
  print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc168_b.py
N = int(input())
S = input()
if len(S)<=N:
    print(S)
else:
    print(S[:N]+'...')

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()

#print(len(S))
#print(S[1:3])

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= S[:K]+"..."
  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:
ln=int(input())
s=input()
l=len(s)
if ln<l:
  print(s[:ln]+'...')

elif ln>=l:
  print(s)

Submission status: Accepted

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

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:
#B
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:
    ans = s
else:
    ans = s[:k] + "..."
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed May 27 14:43:56 2020

@author: 17664
"""

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = int(input())
st = input()

if num < len(st):
  print(st[0:num] + "...")
else:
  print(st)

Submission status: Accepted

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

Submission status: Accepted

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

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