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:
import numpy as np
import sys
#import copy


def xnxn(n=0, flag="v"):
    """
    args:
        int n: a number of lows to read
    example:
        input   1
        retrun  1

        input   1 2 3
        return  [1,2,3]
        input   1 2 3
                4 
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        temp = list(map(int, input().split()))
        if len(temp) == 1:
            if flag == "l":
                return temp
            else:
                return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        temp = [list(map(int, input().split())) for _ in range(n)]
        return temp


def sp_xnxn(n=0):
    """
    args:
        int n: a number of lows to read
    example
        input   1
        retrun  [1]

        input   123
        return  [1,2,3]

        input   123
                4 
        return  [[1,2,3],
                [4]]
    """
    if n == 0:
        return [int(k) for k in xsxs()]
    else:
        return [[int(k) for k in xsxs()] for _ in range(n)]


def xsxs(n=0):
    """
    args:
        int n: a number of lows to read 
    example:
        input   AA
        retrun  AA

        input   A BBB CC
        return  ["A","BBB","CC"]

        input   A BB CCC
                D
        return  [["A","BBB","CC"],
                ["D"]]
    """
    if n == 0:
        temp = list(input().split())
        if len(temp) == 1:
            return temp[0]
        elif len(temp) > 1:
            return temp
    else:
        return [list(input().split()) for _ in range(n)]


def sp_xsxs(n=0):
    """
    args:
        int n: a number of lows to read 
        example:
            input   A
            retrun  ["A"]

            input   ABC
            return  ["A","B","C"]

            input   ABC
                    D
            return  [["A","B","C"],
                    ["D"]]
    """
    if n == 0:
        return [s for s in xsxs()]
    else:
        return [[s for s in xsxs()] for _ in range(n)]


k = xnxn()
s = xsxs()

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:
a = int(input())
b = input()
c = len(b)
if a>=c:
    print(b)
else:
    d = b[0:a]+"..."
    print(d)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
l=[]
t=len(s)
if t<=k:
    print(s)
    exit()
else:
    for i in range(k):
        a=s[i]
        l.append(a)
ans=''.join(l)
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()
length = len(s)
if length <= k:
    print(s)
else:
    print(s[:k]+'...')

Submission status: Accepted

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

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def method():
  max_lenght = int(input())
  string = str(input())

  if len(string) <= max_lenght:
    return string
  else:
    shorten = string[0:(max_lenght)]
    return shorten + '...'

print(method())

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
k = I()
s = S()
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:
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()
A=len(S)
if A<=K:
  print(S)
if A>K:
  print(S[0:K:1]+'...')

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

s = len(S)

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

Submission status: Accepted

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

if K >= len(S):
    print(S)
else:
    print(f"{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:
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 = str(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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[: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:
def output(list_str, len):
  for i in range(len):
    print(list_str[i], end="")

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

if len(S) <= K :
  output(S, len(S))
  print()
else:
  output(S, K)
  print("...")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def Triple_Dots():
    K = int(input())
    S = input()
    S_list = list(S)
    output = ''
    if len(S_list) <= K:
        output = S
    else:
        for i in range(0, K):
            output += S_list[i]
        output += "..."
    print(output)
    
Triple_Dots()

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()
N=len(S)

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

Submission status: Accepted

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

ans = ""
for index, char in enumerate(S):
    if index < K:
        ans += char
    else:
        ans += "..."
        break

print(ans)

Submission status: Accepted

Solution code:
k = int(input())
s = input()
ans = ''
if len(s) <= k:
    print(s)
else:
    for i in s:
        if len(ans) < k:
            ans += i
        else:
            print(ans + '...')
            exit()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if len(s) <= k :
  print(''.join(s))

elif len(s) > k:
  print(str(''.join(s[:k])) + "...")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import heapq
import queue
import itertools
import functools
import operator
import time

readline = sys.stdin.readline
 
IPS = lambda: readline().rstrip()
IP = lambda: int(readline().rstrip())
MP = lambda: map(int, readline().split())
LS = lambda: list(map(int, readline().split()))

def solve():
    for _ in range(1):
        k = IP()
        s = IPS()
        n = len(s)
        if n<=k: print(s)
        else: print(str(s[:k]+"..."))
       
       
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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:
import sys
def input():
    return sys.stdin.readline()[:-1]


def test():
    # n,m,q = map(int, input().split())
    k = int(input())
    s = input()

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


print(test())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
S = input()

if len(S)<=N:
  print(S)
  sys.exit()
  
print(S[0:N]+'...')

Submission status: Accepted

Solution code:
def b(s: str, k: int) -> str:
    if len(s) <= k:
        return s

    return s[:k] + "..."



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

r = b(s, k)
print(r)

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

if len(s)<=k:
    print(s)
else:
    ans=s[0]
    for n in range(k-1):
        ans=ans+s[n+1]
    ans=ans+'...'
    print(ans)

Submission status: Accepted

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

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

if len(moji) <= n:
    print(moji)
else:
    print(moji[:n]+'...')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
lis = list(input())
ans = ""

for id,value in enumerate(lis):
  if id >= N:
    ans += "..."
    break
  else:
    ans += value

print(ans)

Submission status: Accepted

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

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

if len(S) <= K:
    ans = S
else:
    ans = f"{S[:K]}..."

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
K = I()
S = S()

if len(S) <= K:
    print(S)
    sys.exit()
else:
    li = "".join([S[0:K],"..."])
    print(li)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
sys.setrecursionlimit(1000000)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
K = I()
S = S()

if len(S) <= K:
    print(S)
    sys.exit()
else:
    li = "".join([S[0:K],"..."])
    print(li)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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(s)
    exit()
else:
    print(s[:k], end = "")
    print("...")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
l=len(s)
if l<=k:
  print(s)
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, S = int(input()), input()
if len(S) > K:
  print("%s..." % 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:
a = int(input())
s = input()

if len(s) <= a:
    print(s)
else:
    print(s[0:a], end='')
    print("...")

Submission status: Accepted

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

Submission status: Accepted

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

ans = s[:k]
if len(ans) != len(s):
    ans += "..."

print(ans)

Submission status: Accepted

Solution code:
#最初の1文字をインプット
k=int(input())
#文字列を1文字ずつ配列としてインプット
s=list(input())

#確認用
#print(k)
#print(s)

if len(s) <= k: #配列sの文字数がk以下なら
    #print(s)
    print(''.join(s)) #join関数は.以前で指定した文字を結合する関数
else: #配列sの文字数がkを超えているなら
    new_s=s[0:k] #配列の最初からk番目までを切りとる
    new_s.append("...") #末尾に...を加える
    #print(new_s)
    print(''.join(new_s))

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,S] = [input() for i in range (2)]
K = int(K)
L = len(S)
if L <= 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[0:K]+'...')
else:
  print(S)

Submission status: Accepted

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

slist = list(s)
if len(slist) > k:
  l = ''
  for i in range(k):
    l += slist[i]
  print(l + '...')
else:
  print(s)

Submission status: Accepted

Solution code:
#include <CodeforcesSolutions.h>
#include <ONLINE_JUDGE <solution.cf(contestID = "1362",problemID = "B",method = "GET")>.h>
"""
    Author : thekushalghosh
    Team   : CodeDiggers
 
    I prefer Python language over the C++ language :p :D
        
    Visit my website : thekushalghosh.github.io
"""
import sys,math,cmath,time
start_time = time.time()
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################

def solve():
    k = inp()
    s = insr()
    if len(s) <= k:
        print(s)
    else:
        print(s[:k] + "...")
                
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
 
def main():
    global tt
    if not ONLINE_JUDGE:
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")
    t = 1
    for tt in range(t):
        solve()
    if not ONLINE_JUDGE:
        print("Time Elapsed :",time.time() - start_time,"seconds")
        sys.stdout.close()
    
#---------------------- USER DEFINED INPUT FUNCTIONS ----------------------#
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    return(input().strip())
def invr():
    return(map(int,input().split()))
 
#------------------ USER DEFINED PROGRAMMING FUNCTIONS ------------------#
def counter(a):
    q = [0] * max(a)
    for i in range(len(a)):
        q[a[i] - 1] = q[a[i] - 1] + 1
    return(q)
 
def string_counter(a):
    q = [0] * 26
    for i in range(len(a)):
        q[ord(a[i]) - 97] = q[ord(a[i]) - 97] + 1
    return(q)

def power_two(n):
    if n == 1:
        return(True)
    sttr = str(n)
    len_str = len(sttr)
    sttr = list(sttr)
    num = 0
    if (len_str == 1 and sttr[len_str - 1] == '1'): 
        return(False)
    while (len_str != 1 or sttr[len_str - 1] != '1'):
        if ((ord(sttr[len_str - 1]) - ord('0')) % 2 == 1):
            return(False)
        j = 0; 
        for i in range(len_str):  
            num = num * 10 + (ord(sttr[i]) - ord('0')); 
            if (num < 2): 
                if (i != 0):  
                    sttr[j] = '0'
                    j += 1
                continue
  
            sttr[j] = chr((num // 2) + ord('0'))
            j += 1; 
            num = (num) - (num // 2) * 2
        len_str = j
    return(True)

def log_two(n): 
    return(math.log(n) / math.log(2))

#-----------------------------------------------------------------------#
        
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
    input = sys.stdin.readline
    
main()

Submission status: Accepted

Solution code:
import sys
def main():
    K=int(sys.stdin.readline())
    S=list(sys.stdin.readline().strip())
    if len(S)<=K:print(''.join(S))
    else:print(''.join(S[0: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:
def solve():
    K = int(input())
    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(s)
else:
  print(s[:k]+"...")

Submission status: Accepted

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

def actual(k, s) -> str:
    if len(s) <= k:
        return s

    return s[:k] + '...'

print(actual(k, s))

Submission status: Accepted

Solution code:
k = int(input())
n = input()
if k<len(n):
  print(n[:k]+'...')
else:
  print(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:
k = int(input())
s = input()
a = ''
if len(s) <= k:
    print(s)
else:
    for i in range(k):
        a = a + s[i]
    a = a + '...'
    print(a)

Submission status: Accepted

Solution code:
import numpy as np
import scipy as sp
import math

N = int(input())
S = input()
M = int(len(S))
if(M<=N):
  print(S)
else:
  print(S[0:N] + "...")

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

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

m=len(n)

t=int (k)



if(m<=t):
  print(n)
  
else:
  for i, name in enumerate(n):
    if i==t:
      print("...")
      break
    print(name,end='')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
S = str(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):
    for i in range(K):
        print(S[i],end="")
    print("...")
else:
    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()
if len(s) <= k:
    print(s)
else: 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:
    st = S[0:K]+"..."
    print(st)

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

a = len(S)


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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 = list(input())
result =[]
for i,letter in enumerate(s):
    if k == 0:
        result.append("...")
        break
    elif i+1 <= k:
        result.append(letter)
    else:
        result.append("...")
        break
print("".join(result))

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:
import sys
input = sys.stdin.readline

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

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

    print(s)

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

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

S_len=len(S)

three_point='...'

if S_len<=K:
  print(S)
else:
  print(S[0:K]+three_point)

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

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
#import cython

def main():
    read = lambda: sys.stdin.readline().rstrip()
    
    #N: cython.longlong = 0
    K = int(read())
    S = read()
    print(S[:K] + '...' if len(S) > K else S)
 
if __name__ == "__main__":
    main()

Submission status: Accepted

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