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

Submission status: Accepted

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

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:
number=int(input())
word=input()
length=len(word)
if length<=number:
  print(word)
if length>number:
  word=word[0:number]
  print(word+"...")

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

if len(S) <= K:
    print(T)
else:
    A = ''.join(S[:K])
    print(A, '...', 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[0:k]+"...")
else:
    print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# region
import sys
import itertools

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


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


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


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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys 

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
if len(s)>k:
	print(s[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:
nagasa = int(input())
retsu = input()
kazu = len(retsu)
if (nagasa >= kazu):
  print(retsu)
else:
  print(retsu[0:nagasa] + '...')

Submission status: Accepted

Solution code:
import numpy as np
import math
k = int(input())
s = input()
if len(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[:K])
elif len(S) > K:
    print(S[:K] + ("." * 3))

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())
s = readline().rstrip().decode('utf-8')

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K=int(input())
S=input()
SS=list(S)
S1=len(S)
Ans=""
if S1 <= K:
    print(S)
else:
    for k in range(K):
        Ans=Ans+SS[k]
    
    print(Ans+"...")

Submission status: Accepted

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

if len(s)>int(k):
  print(s[0:int(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:
import sys


input = sys.stdin.readline


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


if __name__ == "__main__":
    K = int(input())
    S = input()
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

k = int(input())
s = input()
l = len(s)

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

Submission status: Accepted

Solution code:
kInt = int(input())
sStr = str(input())
sLen = len(sStr)

if (sLen <= kInt):
    print(sStr)
else:
    print(sStr[:kInt] + '...')

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

len_s=len(S)
# print(len_s)

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

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

t = ""
a = len(s)


if k >= a:
    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 = str(input())


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

Submission status: Accepted

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

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

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 = str(input())
l = len(S)
ST = str()
if K >= l:
  for i in range(l):
    ST += str(S[i])
  print(ST)
else:
  for i in range(K):
    ST += str(S[i])
  print(ST +'...')

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

lens = len(s)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(S) <= K:
  print(S)
else:
  n = 0
  while n < K:
    print(S[n],end='')
    n += 1
  print('...')

Submission status: Accepted

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

if __name__ == "__main__":
    solution()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
k=int(input())
s=list(input())
if len(s)<=k:
  print("".join(s))
else:
  print("".join(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 = list(input())
if len(s) <= k:
    print(*s,sep="")
else:
    for i in range(k):
        print(s[i],end="")
    print("...")

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
T = len(S)
if T <= K:
  print(str(S))
else:
  print("{}...".format(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())
#print('n=',n)
m = input()
#print('m=',m)
o = len(m)
#print('o=',o)
if o <= n:
  print(m)
elif o > n:
  print(m[0:n],'...',sep='')

Submission status: Accepted

Solution code:
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

K = int(readline())
S = readline().decode().rstrip()

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

Submission status: Accepted

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

s = int(len(S))
tmp = []

if s <= K:
    print(S)
else:
    for i in range(K):
        tmp.append(S[i])
    tmp.append("...")

#print(tmp)
print("".join(map(str, tmp)))

Submission status: Accepted

Solution code:
K=int(input())
S=input()
list(S)
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:
  b=""
  for i in range(K):
    b+=S[i]
  print(b+"...")

Submission status: Accepted

Solution code:
import sys

val = input()
input_str = input()
 
if 0 > int(val) or int(val) > 100:
    sys.exit()
if 0 > len(input_str) or len(input_str) > 100:
    sys.exit()


if int(val) >= len(input_str):
    print(input_str)
else:
    new_str = input_str[0:int(val)]
    print(new_str + '...')

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:
import sys
input = sys.stdin.readline
def main():
    K = int(input())
    S = input().rstrip()
    if len(S) <= K:
        print(S)
    else:
        print(S[:K]+"...")
if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(S) > K:

    for i in range(0,K):

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

else:

    print(S)

Submission status: Accepted

Solution code:
import numpy as np
k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  print("{}...".format(s[:k]))

Submission status: Accepted

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


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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=input()#制限
b=input()#文字

a=int(a)

if len(b) <= a:
	print(b)

else:
	b2=list(b)
	del b2[a:]
	b3="".join(b2)
	b4=b3+"..."
	print(b4)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
k = int(input())
s = input()
con1 = k >= 1 and k <= 100
con2 = len(s) >= 1 and len(s) <= 100
con3 = s.islower() == True and con2 == True
if con1 == True and con3 == True:
    if k < len(s):
        newstring = s[0:k] + "..."
        print(newstring)
    else:
        print(s)
else:
    print()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

L = len(S)

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

Submission status: Accepted

Solution code:
# cook your dish here
n=int(input())
s=input()
if len(s)<=n:
    print(s)
else:
    s=s[:n]+'...'
    print(s)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
#import collections
# c = collections.Counter()
#import itertools as it
#import math
#import numpy as np
#import sys 
#sys.exit()
 
k = input()
s = input()
#k = int(input())
#a, b  = map(int, input().split())
'''
#  = list(map(int, input().split()))
'''
'''
n = input()
a = [int(input()) for i in range(n)]
'''
'''
n,m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(m)]
'''
 
#-------------------------------#
#len(t)==len(s)+1
#print(t[0:-1])
if int(k)>=int(len(s)):
	print(s)
else:
    t=[s[0:int(k)]]
    t.append('...')
    u = ''.join(t)
    print(u)

Submission status: Accepted

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

n=len(S)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
in_str = input()
in_str2 = input()

if (not in_str.isnumeric()) :
    print("error: 1st arg must be integer")
    exit()

num = int(in_str)
str = in_str2
str_len = len(in_str2)

if num > 100 :
    print("error: 1st arg must be under 100")
    exit()
if str_len> 100 :
    print("error: size of 2nd arg must be under 100")
    exit()

if num >= str_len :
    print(str)
else :
    print(str[0:num] + "...")

Submission status: Accepted

Solution code:
k = int(input())
s = list(input())
if k >= len(s):
  print(''.join(s))
else:
  l = []
  for i in range(k):
    l.append(s[i])
  l.append('...')
  m = ''.join(l)
  print(m)

Submission status: Accepted

Solution code:
import sys

def S():
	return sys.stdin.readline().rstrip()

def I():
	return int(sys.stdin.readline().rstrip())

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

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
def tripledots(K: int, S: str)->str:
    if len(S) <= K:
        return S
    return S[:K] + '...'


if __name__ == "__main__":
    K = int(input())
    S = input()
    ans = tripledots(K, S)
    print(ans)

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

Submission status: Accepted

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

if len(s) <= k:
    print(s)
else :
    t = s[:k]
    t = 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())
N = input()

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i = int(input())

s = input()

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

Submission status: Accepted

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

if len(s) <= k:
    print(s)
else:
    list(s)
    # print(s[:k])
    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())
n = input()
if len(n)<=k:
    print(n)
else:
    N = n[:k]
    print('{}...'.format(N))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def cal():
    k = int(input())
    string = input()
    if len(string) <= k:
        print(string)
    else:
        list1 = list(string)
        for i in range(k):
            print(list1[i], end='')
        print("...")

cal()

Submission status: Accepted

Solution code:
string_list = [input() for i in range(2)]

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())
# print(k)

s = input()
# print(s)
# print(len(s))

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

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

Submission status: Accepted

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

if(num <= n):
    print(k)
else:
    print(k[:n] + '...')

Submission status: Accepted

Solution code:
K = int(input())
S = list(input())
if len(S) <= K:
	word = ""
	for a in S:
		word += a
	print(word)
else:
	i = 0
	word =  ""
	while i < K:
		word += S[i]
		i += 1
	word += "..."
	print(word)

Submission status: Accepted

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

S = len(s)
if S <= k:
    mojiretu = ''
    for x in s:
        mojiretu += x
    print(mojiretu)
else:
    T =s[:-(S-k)]
    mojiretu = ''
    for x in T:
        mojiretu += x
    print(mojiretu + '...')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
m = list(map(str,input()))
if len(m) > n:
    a = m[:n]
    print(''.join(a)+'...')
else:
    for i in m:
        print(i,end='')

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=input()
S=list(input())
answer_str=S[0]
if len(S) <= int(K) :

  for i in range(len(S)-1):
    answer_str += S[i+1] 
  
else :
  for i in range(int(K)-1):
    answer_str += S[i+1] 
  answer_str += "..."
print(str(answer_str))

Submission status: Accepted

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

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

Submission status: Accepted

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

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[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:
#-*-coding:utf-8-*-

def main():
    k = int(input().strip())
    s = input().strip()
    if len(s) <= k:
        print(s)
    elif len(s) > k:
        print(s[:k]+"...")

if __name__=="__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
k =int(input())
s =list(str(input()))
s_s = len(s)
if k >= s_s:
  print("".join(map(str,s)))
  sys.exit()
ans = s[:k]
ans = "".join(map(str,ans))
ans = ans + '...'
print(ans)

Submission status: Accepted

Solution code:
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
# mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!python3

def LI():
    return list(map(int, input().split()))

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


def main():
    n = len(S)
    ans = S
    if n > K:
        ans = S[:K] + "..."
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

A=len(S)
B=()

if A <= K:
      print (''.join(map(str, S)))
else:
      B=(S[0:K])
      B.append("...")
      print (''.join(map(str, B)))

Submission status: Accepted

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

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