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())
n = input()
x = len(n)
if x <= k:
    print(n)
else:
    print(n[: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()
l = len(s)
if l < k + 1:
    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:
import sys
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()) #K: int, Maximum number of characters
S = input() #S: str, Inputed character

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
  K = int(input())
  S = input()
  if len(S) <= K:
    print(S)
  else:
    print(f'{S[:K]}...')

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


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


def read_str_list():
    return input().split()


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


def read_str():
    return input()


def main():
    K = read_int()
    S = read_str()
    if len(S) > K:
      res = S[:K] + '...'
    else:
      res = S
    print(res)


main()

Submission status: Accepted

Solution code:
import math
#####sorting a dictionary#####
def dict_sort(ans):
    ans=sorted(ans.items(),reverse=True,key=lambda kv:(kv[1]))
def is_prime(n,k):
    if n==1:
        return 0
    for i in range(2,int(math.sqrt(n))+1):
        if n%i==0:
            res=i
            break
    return res
def inp():
    ls=list(map(int,input().split()))
    return ls
t=int(input())
s=input()
if len(s)<=t:
    print(s)
else:
    print(s[0:t]+"...")

Submission status: Accepted

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

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

print(S[:K] + '...')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = str(input())
list = []

if len(S) <= K:
    print(S)
else:
    print("{}...".format(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:
#!/usr/bin/env python3


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

if (len(S) <= K):
    print(S)
else:
    print(S[0: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 = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

len = len(s)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k,s = int(input()),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:
import sys
import collections
input = sys.stdin.readline

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=int(input())
S=str(input())
if K>=1 and K<=100 and len(S)>=1 and len(S)<=100:
    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:
n = [input() for i in range(2)]
k_int = int(n[0])
s_str = n[1]

if len(s_str) <= k_int:
    print(s_str)
else:
    print(s_str[0:k_int] + '...')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    k, s = [readline().rstrip() for _ in range(2)]
    print(s[0:int(k)] + "..." if len(s) > int(k) else s)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
word = input()

b = len(word)

if int(a) >= b:
  print(word)
else:
  print(word[0:int(a)] + "...")

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

n = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

S_len = len(S)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os
import heapq
import sys
import math
from collections import defaultdict
from io import BytesIO, IOBase
def main():
    
    #for _ in range(int(input())):
    n=int(input())
    st=input()
    if len(st)<=n:
        print(st)
    else:
        print(st[0:n]+"...")
   
        
    
       
                            


BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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())
news = ""

if k >= len(s):
    print(s)
else:
    for i in range(k):
        news = news + s[i]
    news = news + "..."
print(news)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if n < len(k):
    k = k[:n] + '...'

print(k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k = int(input())
s = input().rstrip()
n = len(s)

if n <= k:
    print(s)
else:
    print(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:
kkk = int(input())
sss = input()
slen = len(sss)

if (slen <= kkk):
    print(sss)
else:
    print(sss[0:kkk] + "...")

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
if 1 <= K and K <= 100:
   if type(K) == int:
      if S.islower() == True:
        if len(S) <= 100 and 1 <= len(S):
          if len(S) <= K:
            ans = S
          else:
            ans = S[:K] + '...'
print(ans)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc168/tasks/abc168_b
K = int(input())
S = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
k = int(input())
s = input()
s2= len(s)
if k >= s2:
    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:
  # len(s) <= k
  print(s)

Submission status: Accepted

Solution code:
K=int(input())
S=input()
ans="..."
if len(S)<=K:
    print(S)

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

Submission status: Accepted

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

S_length = len(S)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def main():
    K, S = open(0).read().split()
    K = int(K)

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

    print(ans)
    return(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


def say_trim_log_words():
    k = input()
    s = input()

    min_length = int(k)

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


if __name__ == '__main__':
    say_trim_log_words()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

num = int(input())
string = input()
if len(string) > num:
    print(string[:num] + "...")
else:
    print(string)

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

K = int(sys.stdin.buffer.readline())
S = sys.stdin.buffer.readline().decode().rstrip()
if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...')

Submission status: Accepted

Solution code:


if __name__ == '__main__':
    k = int(input());
    s = input();

    cnt=0
    for i in s:
        print(i, end='')
        cnt+=1
        if cnt>=k:
            break

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
if 1<=K<=100 and S.lower() and 1<=len(S)<=100:
  if len(S)>K:
    C  = S[:K]
    print(C+"...")
  else:
    print(S)

Submission status: Accepted

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

length = len(str)

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

Submission status: Accepted

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

k = input()
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
if len(s)>k:
  s=list(s)
  ss=s[:k]
  ss.append('...')
  print(''.join(ss))
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:
a=int(input())
b=input()
c=len(b)
if c>a:
    print(b[:a]+'...')
else:
    print(b)

Submission status: Accepted

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

Submission status: Accepted

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

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

if n >= len(li):
    j=""
    for i in range(len(li)):
        j += li[i]
    print(j)
else:
    j=""
    for i in range(n):
        j += li[i]
    j += "..."
    print(j)

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

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

Submission status: Accepted

Solution code:
n = input()
m = input()
 
m_1 = list(m)
 
if len(m_1)>int(n):
  a = "".join(m_1[0:int(n)])
  print(a+"...")
else:
  print(m)

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    k = int(input())
    S = input()
    if len(S) <= k:
        print(S)
    else:
        print(S[:k] + "...")
resolve()

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

k = int(input())
s = input()
print(solve(s, k))

Submission status: Accepted

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

if num < len(input_string):
    difference = -(len(input_string) - num)
    result = input_string[:difference] + '...'
else:
    result = input_string

print(result)

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

Submission status: Accepted

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

if N >= len(bun):
  print(bun)
else:
  print(bun[0:N] + "...")

Submission status: Accepted

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

Submission status: Accepted

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

if length >= len(text):
    print(text)
else:
    print(text[0:length] + "...")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = len(s)

if n > k:
    s = s[:k] + "..."

print(s)

Submission status: Accepted

Solution code:
def solution():
    k = int(input())
    s = str(input())
    if len(s) > k:
        return s[:k] + '...'
    else:
        return s

print(solution())

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

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

k = ni()
s = input()

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

Submission status: Accepted

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


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

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

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

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

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

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())
for i in range(1):
    S = input()

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