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:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

##### dict の for文 #####
# for k, v in d.items():
#     print(k, v)

##### 進数の変換 #####
# bin_str = bin(i)[2:]
# oct_str = oct(i)
# hex_str = hex(i)

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	K = inputInt()
	S = inputStr()

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


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# N 個のボールを K グループに分ける場合のパターン数
def sunuke(N, K, mod=10**9+7):
	if N < K or K-1 < 0:
		return 0
	else:
		return combination(N-1, K-1, mod)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# dfs のサンプル
def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    K = int(rl())
    S = rl().rstrip()
    
    if len(S) <= K:
        print(S)
    else:
        print(S[:K] + '...')


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

def II(): return int(input())
def MII(): return map(int, input().split())
def LII(): return list(map(int, input().split()))

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
n=len(s)
if n<=k:print(s)
else:
  print(s[: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:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    k = i_input()
    s = s_input()

    len_s = len(s)

    if len_s <= k:
        print(s)
        exit()

    for i in range(k):
        print(s[i],end='')

    print('...')    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def get_input() -> tuple:
    """
    標準入力の取得

    Returns:\n
        tuple: 標準入力
    """
    K = int(input())
    S = input()

    return K, S


def main(K: int, S: str) -> None:
    """
    求解処理.

    Args:\n
        K (int): 整数（1 <= K <= 100）
        S (str): 英子文字からなる文字列（1 <= |S| <= 100）
    """
    """
    文字列の長さで場合分け.
    """
    result = str()
    if len(S) <= K:
        result = S
    else:
        result = S[:K] + "..."

    # 結果出力
    print(result)


if __name__ == "__main__":
    K, S = get_input()
    main(K, S)

Submission status: Accepted

Solution code:
import sys

k = int(sys.stdin.readline())
s = sys.stdin.readline().split()[0]

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

print(s)

Submission status: Accepted

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

if K >= len(S) :
  ans = S

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = input()
s = input()
s1 = [i for i in s]
s2 = len(s1)
s3 = []
if int(s2) <= int(k):
  print(s)
else:
  for i in range(int(k)):
    s3.append(s1[i])
  s3.insert(int(k),"...")
  StrA = "".join(s3)
  print(StrA)

Submission status: Accepted

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

leng = len(S)
#print(leng)

if(leng > K):
  word = S[0:K] + '...'
else:
  word = S

print(word)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

    ans = ''
    if len(s) > k:
        ans = s[: k] + '...'
    else:
        ans = s
    
    print(f'{ans}')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
k=int(input());s=input();l=len(s)
print(s[0:min(k,l)]+"."*3*(k<l))

Submission status: Accepted

Solution code:
import sys

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

K = int(K)

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

elif (len(S) > K):
    M = S[:K]
    print(M + "...")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if __name__ == '__main__':
    lines = []
    for line in sys.stdin:
        lines.append(line.rstrip('\r\n'))

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

Submission status: Accepted

Solution code:
def resolve():
    import sys

    input = lambda: sys.stdin.readline().rstrip()

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

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


resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if S.islower() and len(S) <= K:
    print(S)
elif S.islower() and len(S) >= K:
    print(f"{S[0:K]}{'...'}")

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
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 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:
    P = [S[i] for i in range(K)]
    p = "".join(P)
    ans = p + "..."
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def string_k(k, str):
    if len(str) <= k:
        print(str)
    else:
        print(str[0:k]+"...")

k = int(input())
str = input()
string_k(k,str)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

if(k < len(s)):
  print(s[0:k] + "...")
  
if(k >= len(s)):
  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()
SS = (int(len(S)))
if SS-K <= 0:
  print(S)
else:
  print((S[:K-SS])+('.'*3))

Submission status: Accepted

Solution code:
from sys import stdin

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

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

Submission status: Accepted

Solution code:
K=int(input())
S=list(input())
if len(S)>K:
  answer=[]
  for i in range(K):
    answer.append(S[i])
  answer.append('...')
  s=''
  for i in range(len(answer)):
    s+=answer[i]
  print(s)
else:
  g=''
  for i in range(len(S)):
    g+=S[i]
  print(g)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

K = I()
S = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
K = int(input())
S = str(input().lower())
if len(S) <= K:
    print(S)
elif len(S) > K:
    stol = list(S)
    stol[K] = "..."
    Cutlist = stol[0:K+1]
    LtoS = ''.join(map(str, Cutlist))
    print(LtoS)

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:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(IN())
mod=1000000007

#+++++

def main():
	k = int(input())
	#b , c = tin()
	s = input()
	
	if k >= len(s):
		print(s)
		return 
	ret = s[:k]+'...'
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=int(input())
S=input()
p=S[:K]
if(len(S)<=K):
  print(S)
else:
  q=''.join((p,"..."))
  print(q)

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())
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))
k = int(input())
s = list(input())
#print(len(s))
if len(s) <= k:
    print("".join(s))
else:
    t = "".join(s[:k]) + "..."
    print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np


k=int(input())
s=input()
#d=list(map(int,input().split()))
if len(s)<=k:
    print(s)
else:
    s=s[:k]
    s=s+"..."
    print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

list = []

if len(s) <= k:
    print(s)
    sys.exit()
    
for i in range (k):
    list.append(s[i])

list = "".join(list)
print(list +"...")

Submission status: Accepted

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

if K >= len(S):
    print(''.join(S))

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

Submission status: Accepted

Solution code:
from sys import stdin

a=int(stdin.readline())
b=stdin.readline()

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
list_s =list(S)
T = len(list_s)
if T > K:
    for i in range(K,T):
        del list_s[K]
    S =""
    for i in range(K):
        S += list_s[i]
    S += '...'
print(S)

Submission status: Accepted

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

# from collections import deque

def linput(_t=int):
    return list(map(_t, input().split()))

def gcd(n,m):
    while m: n,m = m, n%m
    return n

def lcm(n,m): return n*m//gcd(n,m)

def main():

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

    # res = 0
    # print(N)

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

    print(res)
    # print(("No","Yes")[res%2])



main()

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
#import time
#import copy
#from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
#import itertools
#input = sys.stdin.readline
#sys.setrecursionlimit(10**6)
 
def ri():
    return list(map(int, input().split()))
def rs():
    return list(input().strip())
 
k = int(input())
s = str(input())
if len(s)<=k:
    print(s)
else:
    print(s[:k]+"...")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# coding: utf-8
def main():
    K = int(input())
    S = input()
    if len(S) <= K:
        print(S)
    else:
        print(S[:K] + '...')
 
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def i_input(): return int(input())
def s_input(): return input()

def main():
    k = i_input()
    s = s_input()

    len_s = len(s)

    if len_s <= k:
        print(s)
        exit()

    for i in range(k):
        print(s[i],end='')

    print('...')    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

N = len(S)

A = str(S)[0 : K]

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

Submission status: Accepted

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

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

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


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

def main():
    N = int(input())
    l = input()
    ll = list(l)
    if len(l) <= N:
        print(l)
    else:
        kl = ''.join(ll[:N])
        print(kl+"...")
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

n = x[0]
word = x[1]


letter_num = len(word)


word_num = list(word)

if letter_num <= int(n):
    print(word)

else:
    words = list(word)
    l = list()
    m = 0
    for i in range (int(n)):
        l.append(words[int(m)])
        m += 1
        
    l.append("...")
    
    answer = " "
    
    for j in l:
        answer += j
    print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

l = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(z) > a: 
  print(z[0:a] + "...")
else:
  print(z)

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()
s = list(s)
if len(s) > k:
    a = s[:k]
    print("".join(a) + "...")
    
elif len(s) <= k:
    print("".join(s))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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