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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
  k = int(input())
  s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - ... (Triple Dots)
K = int(input())
S = input()
if len(S) <=K:
    print(S)
else:
    print(S[0:K]+"...")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

Submission status: Accepted

Solution code:
# B - Triple Dots

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math

n=int(input())
a=list(str(input()))
if len(a)<=n:
    print(''.join(a))
else:
    b=a[:n]+['...']
    print(''.join(b))

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

Submission status: Accepted

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

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

print(solve(K, S))

Submission status: Accepted

Solution code:
inf = 10 ** 15
mod = 10 ** 9 + 7
k = int(input())
s = input()
if len(s) <= k:
    print(s)
else:
    print('{}{}'.format(s[:k],'...'))

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
def main():
    K = int(input())
    S = input()
    if len(S) <= K:
        print(S)
    else:
        print(S[0:K] + '...')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

n = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
#文字列を一文字ずつ数字に変換、'5678'を[5,6,7,8]とできる
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
#文字列として取得
def ST(): return sys.stdin.readline().rstrip()
def LST(): return sys.stdin.readline().rstrip().split()
def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**6+10)

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

Submission status: Accepted

Solution code:
from collections import deque
from collections import defaultdict
k = int(input())
s =input()
# a = list(map(int, input().split()))
# n,m = map(int, input().split())
# b = [int(input()) for _ in range(n)]

l = len(s)

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate, product, combinations_with_replacement
import sys
import bisect
import string
import math
import time


def I(): return int(input())
def S(): return input()
def MI(): return map(int, input().split())
def MS(): return map(str, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def print_matrix(mat):
    for i in range(len(mat)):
        print(*['IINF' if v == IINF else "{:0=4}".format(v) for v in mat[i]])


yn = {False: 'No', True: 'Yes'}
YN = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**19
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
show_flg = False
# show_flg = True


def main():
    K = I()
    s = S()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
k=int(input())
s=str(input())
temps=list(s)
if len(temps)<=k:
  print(s)
else:
  a=[0]*k
  for i in range(0,k):
    a[i]=s[i]
  print("".join(a)+"...")

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

if len(S) <= K:
    print(S)
    exit()
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], end='...')
  print('')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def convert(s): 
  
    # initialization of string to "" 
    new = "" 
  
    # traverse in the string  
    for x in s: 
        new += x  
  
    # return string  
    return new 
k=int(input())
s=input()
if len(s)<=k:
  print(s)
else:
  a=[]
  for i in range(k):
    a.append(s[i])
  a.append('...')
  print(convert(a))

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 numpy as np
#import math
#import itertools
#import re
#from functools import lru_cache

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

k=n_in()
s=s_in()

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

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

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

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:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(K, S):
    if len(S) <= K:
        return S
    return S[:K] + '...'


def main():
    K = read_int()
    S = read_str()
    print(slv(K, S))


if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
from sys import stdin, stdout

int_in = lambda: int(stdin.readline())
arr_in = lambda: [int(x) for x in stdin.readline().split()]
mat_in = lambda rows: [arr_in() for y in range(rows)]
str_in = lambda: stdin.readline().strip()
out = lambda o: stdout.write("{}\n".format(o))
arr_out = lambda o: out(" ".join(map(str, o)))
bool_out = lambda o: out("YES" if o else "NO")


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


if __name__ == "__main__":
    k = int_in()
    s = str_in()
    out(solve(k, s))

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding:utf-8 -*-
def output_S(S, K):
    if len(S)<=K: return S
    else: return S[0:K] + "..."

def main():
    K = int(input())
    S = input()
    print(output_S(S, K))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

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

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()
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:
from sys import stdin
K = int(stdin.readline().rstrip())
S = (stdin.readline().rstrip())
if len(S) <= K:
    print(S)
else:
    print(S[:K]+"...")

Submission status: Accepted

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

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

main()

Submission status: Accepted

Solution code:
# B - ... (Triple Dots)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
#N = int(input())
#J,K = map(int,input().split())
#A = list(map(int,input().split()))
#A = [list(map(int,input().split())) for _ in range(N)]
#for i in range():

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

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

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

Submission status: Accepted

Solution code:
import sys
K = int(sys.stdin.readline().rstrip())
S = sys.stdin.readline().rstrip()

N = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque 
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)

def main():
    mod = 10**9+7
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    K = int(input())
    S=input()
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列


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




if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？


k=ii()
arr=list(ss())

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


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


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:
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

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

#処理内容
def main():
	K = int(input())
	S = input()
	M = len(S)
	if K >= M:
		print(S)
	else:
		ans = S[:K] + "..."
		print(ans)





if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

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:
import itertools as iter
import math as m

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## coding: UTF-8
K = int(input())
S = input()

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

Submission status: Accepted

Solution code:
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

k=I()
s=SI()

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    print(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:
#B
k = int(input())
s = input()

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
# MOD = 10**9+7
# MOD = 998244353

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

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

Submission status: Accepted

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
from functools import reduce
import math
import itertools
import heapq
import numpy as np
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))


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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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()
l = len(s)
if l<=k:
  print(s)
else:
  a = s[:k]
  print(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:
import sys

k, s = sys.stdin.read().split()
k = int(k)
def main():
    if len(s) <= k:
        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:
    a = s[:k]
    a += "..."
    print(a)

Submission status: Accepted

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

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

if len(S) > K:
    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())
s = input()

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

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=list(input())
if len(s)<=k:
  print(''.join(s))
else:
  s2=s[0:k]
  for i in range(3):
    s2.append('.')
  print(''.join(s2))

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

Submission status: Accepted

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


def solve(K: int, S: str):
    if len(S) > K:
        print(S[:K]+"...")
    else:
        print(S)
    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:
# coding:utf-8
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 = str(input())
if len(s) <= k:
    print(s)
else:
    ans = s[0:k]+'...'
    print(ans)

Submission status: Accepted

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

K = int(input())
S = input().rstrip()

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
#n,m,k=map(int,input().split())
#a=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]


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

Submission status: Accepted

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

if __name__ == '__main__':
    resolve()