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

Submission status: Accepted

Solution code:
n=int(input())
w=input()
alen=len(w)
blen=len(w)

if blen > n:
    
    print(w[:n]+"..." )
else:
    print(w)

Submission status: Accepted

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

print(txt[:n]+"..." if bool(txt[n:]) else txt)

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

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

Submission status: Accepted

Solution code:
k = int(input())
s = input()
t = s[0]
if len(s) <= k:
    print(s)
else:
    for i in range(1, k):
        t += s[i]
    print(t + '...')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if k >= len(l):
  print(l)
else:
  print(l[: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,s=open(0).read().split();print(s if len(s)<=int(k) else s[:int(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()

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

Submission status: Accepted

Solution code:
#168B
#…(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(s[0:k]+"...")

Submission status: Accepted

Solution code:
K=int(input())
S=input()
list1=[]
if len(S)<=K:
  print(S)
else:
  for i in range(K):
    list1.append(S[i])
  list1.append("...")
  S2="".join(list1)
  print(S2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
s=list(input())
num_list=[]
if k<len(s):
    for x in range(k):
        num_list+=s[x]
        x+=1
    t=''.join(num_list)+'...'
else:
    t=''.join(s)
print(t)

Submission status: Accepted

Solution code:
from sys import stdin
data = stdin.readlines()

k = int(data[0].split()[0])
s = data[1].split()[0]

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

if len(s) <= n:
    print(s)
else:
    print(s[0:n],'...', sep='')

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

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    K = II()
    S = input()

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = list(input())
if len(S) <= K:
    print(*S,sep="")
else:
    S2 = S[:K]
    S2.append("...")
    print(*S2,sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys

stdin = sys.stdin


def ni(): return int(ns())


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


def naa(N): return [na() for _ in range(N)]


def ns(): return stdin.readline().rstrip()  # ignore trailing spaces


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

Submission status: Accepted

Solution code:
nb = int(input())
sentence = input()

if len(sentence) > nb:
	print(sentence[0:nb] + '...')
else:
	print(sentence)

Submission status: Accepted

Solution code:
k = int(input()) 

s = input() 
string = ''

if k < len(s):
    for x in range(k):
        #''.join(s[x])
        string = string + s[x]
    string = string + '...'
else:
    string = s

print(string)

Submission status: Accepted

Solution code:
import sys
#長さK
K = int(input())

#文字列S
S = input()

#print(type(len(S)))
#print(type(K))
#print(str(S))

if len(S) <= K:
    print(S)
    sys.exit()

else:
    S = str(S)
    print(S[:K]+"...")
    sys.exit()

Submission status: Accepted

Solution code:
from sys import stdin
from collections import defaultdict as dd
from collections import deque as dq
import itertools as it
from math import sqrt, log, log2
from fractions import Fraction

# t = int(stdin.readline())
# for _ in range(t):
# n, m = map(int, stdin.readline().split())
# nums = list(map(int, stdin.readline().split()))
# n = int(input())
# if n%10 in [2, 4, 5, 7, 9]:
#     print('hon')
# elif n%10 in [0, 1, 6, 8]:
#     print('pon')
# else:
#     print('bon')

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

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

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

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 = list(input())
S2 = []

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

Submission status: Accepted

Solution code:
import sys

k, s = sys.stdin.readlines()
k = int(k)
s = s.strip()
if len(s) <= k:
    print(s)
else:
    print('{}...'.format(s[:k]))

Submission status: Accepted

Solution code:
s = int(input())
k = input()
if len(k) > s:
	print("%s..." % k[:s])
else:
	print(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)
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)
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('{}...'.format(s[:k]))
else:
    print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = str(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:
  s = s[:k]
  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 = input()

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

Submission status: Accepted

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

if K < len(S):
        print(str(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, s = open(0).read().split(maxsplit=2)
k = int(k)
if len(s) <= k:
    print(s)
else:
    print(s[:k] + "...")

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
K=int(input())
S=list(input())
a=[]
if len(S)<=K:
    print(''.join(S))
else:
    for i in range(0,K):
        a.append(S[i])
        
    print(''.join(a)+'...')

Submission status: Accepted

Solution code:
k=int(input())
word=input()
if len(word)<k+1:
  print(word)
elif len(word)>k:
  count=0
  for i in word:
    print(i,end="")
    count+=1
    if count==k:
      break
  print("...")

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
E = ''
if K >= len(S):
  print(S)
else:
  for i in range (K):
    E += S[i]
  print(E + '...')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

#import numpy as np


def main():
	k=II()
	s=input()

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
















if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
#input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

#import numpy as np


def main():
	k=II()
	s=input()

	if len(s)<=k+1:
		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:
s = int(input())
k = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


def int1(x): return int(x) - 1
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def mi1(): return map(int1, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def lli(rows_number): return [li() for _ in range(rows_number)]


if __name__ == "__main__":
    k = ii()
    s = input()
    if len(s) <= k:
        print(s)
    else:
        print(s[:k] + '...')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    cnt = int(input())
    str = input()

    sum_str = []
    sum_cnt = 0
    for i in range(len(str)):
        sum_cnt += 1
        if (sum_cnt > cnt):
            sum_str.append('...')
            break
        sum_str.append(str[i])

    str2 = ''.join(sum_str)

    print(str2)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin, stdout
for _ in range(1):#int(stdin.readline())
    n=int(stdin.readline())
    s=input();cur=len(s)
    print(s[:n]+'...'*(cur>n))

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

Solution code:
def main():
  l = int(input())
  w = input()
  
  wl = len(w)
  
  if wl > l:
    word = w[:l]
    
    w = word + '...'
    
  print(w)
  
  
main()

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 = str(input())
S_K = S[0:K]
dot = '...'


if len(S) <= K :
    print(S)
else :
    print(S_K + dot)

Submission status: Accepted

Solution code:
def solve(K,S):
  if len(S) <= K:
    return S
  else:
    return (S[:K] + "...")

K = int(input())
S = input()
ans = solve(K,S)
print(ans)

Submission status: Accepted

Solution code:
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()

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

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

K = int(input())
S = str(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:
    print("{}...".format(S[:K]))
else:
    print(S)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input_num = int(input())
input_str = input()

if input_num < len(input_str):
	print(input_str[0:input_num] + '...')
else:
	print(input_str)

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:
	st = []
	for i in range(n):
		st.append(s[i])
	st.append("...")
	print("".join(st))

else:
	print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
cnt = '...'

if len(S) <= K:
    print(S)
else:
    print(S[:K] + str(cnt))

Submission status: Accepted

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

if len(S) <= K:
    print(S)
elif len(S) > K:
    ans = S[0]
    for i in range(1,K):
        ans += S[i]

    for j in range(3):
        ans += '.'

    print(ans)

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

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

Submission status: Accepted

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

if n<=k:
    print(s)
else:
    print(s[:k],end='')
    print('.'*3)

Submission status: Accepted

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

deffirence = len(S) - K

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

Submission status: Accepted

Solution code:
"""
int #整数
float #小数

#for
for name in fruits: #fruitの頭から操作
    print(name)
    
#リスト
list0 = [] #リスト生成
list0 = [1,2,3,4] #初期化
list0 = [0]*10 #[0,0,0,0,0,0,0,0,0,0]
list1= [i for i in range(10)] #>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list1 = list(map(int, input().split()))　# 複数の入力をリストに入れる
number=[int(input()) for i in range(int(input()))] #複数行の入力
list1 = list1 + [6, 7, 8] #リストの追加
list2.append(34) #リストの追加　最後に（）内が足される
list.insert(3,10) #リストの追加　任意の位置（追加したい位置,追加したい値）
len(list4) #リストの要素数
max(sa) #list saの最小値
list5.count(2) #リスト内の2の数
list1.sort() #並び替え小さい順
list1.sort(reverse=True)  #並び替え大きい順
set(list1) #list1内の重複している要素を削除し、小さい順に並べる

abs(a) #aの絶対値
max(a,b) min(a,b) #最大値　最小値
text1 = text1.replace("34","test") #text1内の"34"を"test"に書き換える(文字列内の文字を入れ替える)

exit(0) #強制終了
"""
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[:k]+"...")
else:
    print(s)

Submission status: Accepted

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








main()

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 k < len(s):
    print(s[:k%len(s)]+"...")
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()
import numpy as np
p=list(s)
l=len(p)
if l<=k:
  print(s)
else:
  arr=np.array(p)
  arr=arr[0:k]
  print(''.join(list(arr))+'...')

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 k>=len(s):
    print(s)
elif k!=len(s):
    print(str(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 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[: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())
S=input()
if len(S)<=K:
    print(S)
else:
    T=[]
    S=list(S)
    for i in range(K):
        T.append(S[i])
        K="".join(T)
    print(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)
else:
  print(s[:k]+'...')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    k = int(input())
    s = input()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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:
  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()) # k=整数
s = input()  # s = 文字列
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 k < len(s):
    print(s[:k] + '...')
else:
    print(s)

Submission status: Accepted

Solution code:
def triple_dot():
    k = int(input())
    s = input()
    len_s =len(s)
    result_s = []
    
    if len_s > k:
        for i in range(k):
            result_s.append(s[i])
        print("".join(result_s) + "...")
    else:
        print("".join(s))
triple_dot()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n, s = open(0).read().split()
n = int(n)
if len(s) <= n:
  print(s)
else:
  print(s[:n] + '...')

Submission status: Accepted

Solution code:
#!/usr/bin/env python
"""AtCoder Beginner Contest 168: B - ... (Triple Dots)
https://atcoder.jp/contests/abc168/tasks/abc168_b
"""


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = s
if l > k:
    ans = f'{s[:k]}...'

print(ans)