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:
max_letter = int(input())
letter_crowd = input()
letter_length = len(letter_crowd)

if max_letter >= letter_length:
    print(letter_crowd)

else:
    print(letter_crowd[:max_letter] + '...')

Submission status: Accepted

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

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:
n = int(input())
s = input()
if n < len(s):
  for i in range(n):
    print(s[i], end="")
  print("...")
else:
  print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

if a>K:
    print(S[:K]+'...')
else:
    print(S)

Submission status: Accepted

Solution code:
i = input()
i2 = input()

l2 = list(i2)
if(len(l2) <= int(i)):
  print(i2)
else:
  print("".join(l2[0:int(i)])+'...')

Submission status: Accepted

Solution code:
n =int( input().rstrip() )
s = input().rstrip()
L = len(s)

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

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

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

Submission status: Accepted

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

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

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

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

print(ans)

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,s=open(0)
k=int(k)
print(s[:k]+'...'*(len(s)-1>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()
ans = s if len(s) <= k else s[:k] + "..."
print(ans)

Submission status: Accepted

Solution code:
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

k = int(input())
str = input()
len = len(str)

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

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

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())
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]+'...')

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    k = ni()
    s = ns()

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

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

Submission status: Accepted

Solution code:
from sys import stdin

k = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

K = int(sys.stdin.readline().rstrip())
S = sys.stdin.readline().rstrip()
if len(S) > K:
    print('{}...'.format(S[0:K]))
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:
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().strip())
n = input().strip()
print(n if len(n) <= k else n[:k] + "...")

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    K = read_int()
    S = input().strip()
    if len(S) <= K:
        return S
    return S[:K]+'...'


if __name__ == '__main__':
    print(solve())

Submission status: Accepted

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

if k>S:
    print(K[:S]+'...')
else:
    print(K)

Submission status: Accepted

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

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

print(answer)

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

Submission status: Accepted

Solution code:
def main():
    k = int(input())
    s = input()
    ans = solve(k, s)
    print(ans)


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


if __name__ == '__main__':
    main()

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())
l=len(S)
if l<=k:
	print(S)
else:
	am=[S[i] for i in range(k)]
	am.append("...")
	an="".join(str(i) for i in am)
	print(an)

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
a=list(s)
b=""
if len(s)<=k:
  print(s)
else:
  for i in range(0,k): 
    b+=a[i]
  print(b+"...")

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

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:
n=int(input())
chara=input()
nc=len(chara)

if n>=nc:
  print(chara)
else:	
  print(chara[0:n]+"...")

Submission status: Accepted

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

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

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:
def solve(string):
    k, s = string.split()
    k = int(k)
    return s if len(s) <= k else s[:k] + "..."


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
s = str(input())

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
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()
len=len(s)
if len<=k:
  print(s)
else:
  print(str(s[: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:
# coding: utf-8
import sys,pprint

K = int(input())
S = input().rstrip()

if len(S) > K:
    print("{0}{1}".format(S[0:K],'...'))
else:
    print(S)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    import sys
    length = int(sys.stdin.readline())
    string = sys.stdin.readline().strip()

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m=int(input(""))
n=input("")

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict as dd

def ri():
    return int(input())

def rl():
    return map(int, input().split())

def rl2():
    return list(rl())

s = ri()
k = input()

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

Submission status: Accepted

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

add="..."

if len(s)<=k:
    ans=s
else:
    ans=s[:k]+add

print(ans)

Submission status: Accepted

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

ans = S

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

print(ans)

Submission status: Accepted

Solution code:
def solve(K,S):
    return "".join(S) if(len(S) <= K) else "".join(S[:K]) + "..."
        
    return
def main():
    K = int(input())
    S = list(input())
    # solve()
    print(solve(K,S))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
T = ''
if len(S) <= K:
    print(S)
else:
    for k in range(K):
        T += S[k]
    print('{}{}'.format(T, '...'))

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

if s <= K:
  print(S)
else:
  print(S[: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:
n = int(input())
s = input()

if len(s) > n:
    print(s[:n] + '.'*3)
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[:K]+'...')
else:
  print(S)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
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[0:K] + "...")

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

s=input()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
inputk = input()
k = int(inputk)
s = input()
#len()は文字数取得
if(len(s) <= k): print(s)
else: print(s[0 : k] + "...")

Submission status: Accepted

Solution code:
import sys
K = int(sys.stdin.readline().rstrip())
S = list(sys.stdin.readline().rstrip())
if K >= len(S):
    print(''.join(S))
    
else:
    s = ''.join(S[:K])
    print(f'{s}...')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys
import heapq
import bisect
import itertools
import queue
import copy
import time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

def inpl_strl(): return list(sys.stdin.readline())

K = inp()
S = input()
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[:k]+ "...")
else:
    print(s)

Submission status: Accepted

Solution code:
from sys import stdin, stdout
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	k = int(rl())
	s = rll()[0]
	if len(s) > k:
		print("".join([s[:k], "..."]))
	else:
		print(s)
	stdout.close()

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
# B - ... (Triple Dots)
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(f'{s[:k]}...')

Submission status: Accepted

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

aa = []

if len(S) <= K:
  print(S)
else:
  for x in range(K):
    aa.append(S[x])
  print("".join(aa) + "...", sep = "")

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:
# B - ... (Triple Dots)
def main():
    K = int(input())
    S = input().rstrip()
    print(S if len(S) <= K else 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())
S = input()
if len(S) > K:
	print(S[:K] + '...')
else:
	print(S)

Submission status: Accepted

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
seigen = int(input())
word = input()
mojisuu = len(word)
mojiretu = list(word)
tansyuku = ""

if mojisuu > seigen:
    mojiretu = list(word)
    for i in range(seigen):
        tansyuku += mojiretu[i]
    tansyuku += "..."
    print(tansyuku)
else:
    print(word)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

def moji(S,K):
    if len(S)<=K:
        print(S)
    else:
        T=""
        for i in range(len(S)):
            if i <K:
                 T+=S[i]
            if i >=K:
                continue
        T+="..."
        print(T)

moji(S,K)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))
##########
def main(k,s):
    if len(s) <= k : return s
    return s[:k]+"..."

def resolve():
    k = ii()
    s = input()
    print(main(k,s))

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

a = len(s)
b = ''

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

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()
lens = len(s)

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

Submission status: Accepted

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

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:
#!/usr/bin/env python2

import sys

input = iter(sys.stdin.readlines()).next

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

   return 0

if __name__ == '__main__':
   sys.setrecursionlimit(10000)
   main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
def input():return sys.stdin.readline()[:-1]
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
def YesNo(x):print("Yes")if x==True else print("No")
k=N()
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)
ans = s
if l>k:
    ans = s[0:k]
    ans += '...'
print(ans)

Submission status: Accepted

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

Sl = list(S)

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

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
length = int(input())
strings = input()

if len(strings) <= length:
    print(strings)
else:
    print(f"{strings[0:length]}...")

Submission status: Accepted

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

if (n := 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();print(s[:k]+'.'*3*(len(s)>k))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a=len(s)

if k >= a:
  print(s)

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

Submission status: Accepted

Solution code:

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

a=len(s)

if k >= a:
  print(s)

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

Submission status: Accepted

Solution code:
#b
k = int(input())
s = input()
ss = list(s)

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

Submission status: Accepted

Solution code:
k = int(input())
s = input()
print(s[:k] + "..." * (len(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
K = int(sys.stdin.readline())
S = sys.stdin.readline().rstrip()
if len(S) > K:
    print(S[:K] + "...")
else:
    print(S)

Submission status: Accepted

Solution code:
import sys
K = int(sys.stdin.readline())
# S = sys.stdin.readline()
S = sys.stdin.readline().rstrip()
if len(S) > K:
    print(S[:K] + "...")
else:
    print(S)

Submission status: Accepted

Solution code:
n=int(input())

s=input()

l=len(s)

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

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

Submission status: Accepted

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

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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

k = int(readline())
s = read().rstrip().decode()
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)
else: print(s[:n]+'...')

Submission status: Accepted

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