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

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    k = ii()
    s = input()
    n = len(s)
    if n <= k:
        print(s)
    else:
        print(s[:k] + '...')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
if K >= len(S):
    print(S)
else:
    S = list(S)
    del S[K:]
    print("{}...".format("".join(S)))

Submission status: Accepted

Solution code:
num = int(input())
a = input()
if len(a) > num:
    i = 0
    for moji in a:
        if i < num:
            print(moji, end = "")
            i += 1
    print("...")
else:
    print(a)

Submission status: Accepted

Solution code:
if __name__=="__main__":
    # Problem B
    K = input()
    S = input()
    K_len = int(K)
    S_len = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
def main():
    K = int(input())
    S = input()
    
    l = len(S)
    
    if l <= K:
        out = S
    else:
        new_s = S[:K] + str('...')
        out = new_s

    print(out)
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left
from heapq import *
import sys
# sys.setrecursionlimit(1000000)
INF = 10 ** 17
MOD = 998244353

def check(mid, points, origin, rotate):
    height = origin * math.cos(math.radians(rotate))
    # print(height)
    cs = math.cos(math.radians(rotate))
    sn = math.sin(math.radians(rotate))
    for px, py in points:
        py = py - origin
        rx, ry = px*cs - py * sn, px * sn + py * cs
        if abs(rx) > height + 0.0000001 or abs(ry) > height + 0.0000001:
            # print("FALSE", rotate)
            return False

    return True


class Segtree_op():
    def __init__(self, n):
        self.size = 1
        while (n >= 1):
            self.size = self.size << 1
            n = n // 2

        self.arr = [self.unit() for i in range(self.size * 2)]

    def op(self, lch, rch):
        return lch + rch

    def unit(self):
        return 0

    def update(self, k, val):
        k += self.size - 1
        self.arr[k] = val
        while (k):
            k = (k - 1) // 2
            self.arr[k] = self.op(self.arr[k * 2 + 1], self.arr[k * 2 + 2])

    def query(self, l, r):
        L = l + self.size
        R = r + self.size
        s = self.unit()
        while L < R:
            if R & 1:
                R -= 1
                s = self.op(s, self.arr[R - 1])

            if L & 1:
                s = self.op(s, self.arr[L - 1])
                L += 1
            L >>= 1
            R >>= 1
        return s

    def show(self):
        idx = 1
        while (idx <= self.size):
            print(self.arr[idx - 1:idx * 2 - 1])
            idx *= 2


def solve():
    k = getN()
    s = input().strip()
    if len(s) <= k:
        print(s)
        return
    else:
        print(s[:k] + "...")

def main():
    n = getN()
    for _ in range(n):
        solve()
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
#########行列読み込み ##############################################
"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""
##################################################################
#########入力系####################################################
"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""
##################################################################

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

if len(S)<=K:
    for i in S:
        print(i,end="")
else:
    S_ = []
    S_ = S[0:K]
    S_.append("...")
    #print(S_)
    for j in S_:
        print(j,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):
  print(s)
else:
  print(s[0:k]+"...")

Submission status: Accepted

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

if len(S) <= K:
      print("".join([str(n) for n in S]))

else:
         m = S[0:K]
         m.append('...')
         print("".join([str(n) for n in m]))

Submission status: Accepted

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

Submission status: Accepted

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

a = len(s)

if k >= a:
    print(s)

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

Submission status: Accepted

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

import sys

def solve(K: int, S: str):
    if (len(S) <= K):
        print(S)
    else:
        print(S[0:K], "...", sep='')
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(K, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

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

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

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:
# -*- coding: utf-8 -*-
K = int(input())
S = input()
print("{}{}".format(S[:K], '...' if len(S) > K else ''))

Submission status: Accepted

Solution code:
import numpy as np

K = int(input())
S = input()
S = list(S)
mojiretu=''
if len(S) <= K:
    for x in S:
        mojiretu += x
    print(str(mojiretu))

else:
    del S[K:len(S)]
    for x in S:
        mojiretu += x
    print(str(mojiretu)+'...')

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

ss = list(s)

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

Submission status: Accepted

Solution code:
K=int(input())
S=input().split()
S=str(S[0])

num=len(S)


if num<=K:
    print(S)
    
elif num>K:
    res=S[:K]
    print(res+"...")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

if len(b) <= int(a):
    print(b)
else:
    print(b[0:int(a)]+'...')

Submission status: Accepted

Solution code:
import sys
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)
else:
    ss = s[0:k]
    print(ss+'...')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def inp():
    return(int(input()))


k = inp()

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

Submission status: Accepted

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

        S_list = list(S)
        l = len(S_list)

        ans = []

        if l <= K:
                for i in range(l):
                        ans.append(S_list[i])
        else:
                for i in range(K):
                        ans.append(S_list[i])
                ans.append("...")

        ans = "".join(map(str,ans))
        print("{}".format(ans))

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:
#import re
import sys
#import heapq
#import bisect
#from collections import deque
#import math

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:
if __name__=='__main__':
  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()

ans  = ""

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

Submission status: Accepted

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

Submission status: Accepted

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

a = len(S)

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

Submission status: Accepted

Solution code:
# print('input >>')
K = int(input())
S = input()

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

# print('-----output-----')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
s = list(map(str, input()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if len <= K:
  print(S)

if len > K:
  for i in range(K):
    text.append(S[i])

  ans = ''.join(text)
  print(ans + '...')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - ... (Triple Dots)
k=int(input())
s=input()

lengths=len(s)

if lengths<=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()
if len(s) <= k:
    print(s)
else:
    ss = list(s)
    sss = ''.join(ss[:k]) + "..." 
    print(sss)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

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

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print(S[:K], "...", 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:
num=int(input())
line=list(input())
if len(line)>num:
  line=line[:num]
  line.append("...")
linemap = map(str, line)
line = ''.join(linemap)
print(line)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
  print(S[0:K],end='...')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def resolve():
    k=int(input())
    s = str(input())
    n=len(s)
    if n<=k:
        a = str(''.join([x.strip() for x in s.split(',')]))
        print(a)
    else:
        t = s[:k]+"..."
        a = str(''.join([x.strip() for x in t.split(',')]))
        print(a)
resolve()

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

if len(s)<=k:
  print(s)
else:
  answer=[]
  for i in range(k):
    answer.append(s[i])
  answer.append("...")
  print(*answer,sep="")

Submission status: Accepted

Solution code:
import math
#def main(S, b):
if __name__ == '__main__':
    #a, b, c, k = map(int, input().split())
    k = int(input())
    n = input()
    #print(n[-1])
    if (len(n) <= k):
        print(n)
    else:
        print(n[:k] + "...")

    # if (s == t[:(len(s))] and len(t) == len(s) + 1):

    #     print("Yes")
    # else:
    #     print("No")
    # s = sum(a)

Submission status: Accepted

Solution code:
import os

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
K = int(input())
S = str(input())
S_ = list(S)
S_kari = ''

if K >= len(S_):
  print(S)
else:
  for i in range(K):
    S_kari += S_[i]
  S_kari += '...'
  print(S_kari)

Submission status: Accepted

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

ans = S[0:K]

if len(ans) < len(S):
    print(ans + '...')
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if len(s) <= k:
    print(s)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
s=[i for i in input()]

ans=0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

slen = len(S)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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())
word = input()
printlen = min(n, len(word))
if(printlen == len(word)):
   print(word)
else:
   print(word[:n] + '...')

Submission status: Accepted

Solution code:
cut = int(input())
moji = input()

length = len(moji)


if length <= cut:
  print(moji)
else:
  print("{}...".format(moji[0:cut]))

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)

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

Submission status: Accepted

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

s_len = len(s)
if s_len <= k:
    print(s)
else:
    print('%s...'%(s[0:k]))

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    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)

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