Problem:


Score: 200 points

Problem Statement

We have a string S consisting of lowercase English letters.

If the length of S is at most K, print S without change.

If the length of S exceeds K, extract the first K characters in S, append ... to the end of them, and print the result.

Constraints

K is an integer between 1 and 100 (inclusive).

S is a string consisting of lowercase English letters.

The length of S is between 1 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

K
S

Output

Print a string as stated in Problem Statement.

Sample Input 1

7
nikoandsolstice

Sample Output 1

nikoand...

nikoandsolstice has a length of 15, which exceeds K=7.

We should extract the first 7 characters in this string, append ... to the end of them, and print the result nikoand....

Sample Input 2

40
ferelibenterhominesidquodvoluntcredunt

Sample Output 2

ferelibenterhominesidquodvoluntcredunt

The famous quote from Gaius Julius Caesar.



Sample input:
7
nikoandsolstice


Sample output:
nikoand...

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k =int(input())
s =input()
ans = ''
if k>len(s):
  k = len(s)
for i in range (k):
  ans = ans+s[i]

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

Submission status: Accepted

Solution code:
number=int(input())
string=input()
characters=len(string)
empty=""
if characters<=number:
    print(string)
else:
   i=0
   while i<=number-1:
       empty+=string[i]
       i=i+1
   print(f"{empty}...")

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()
characters=len(s)
empty=""
if characters<=k:
    print(s)
else:
   i=0
   while i<=k-1:
       empty+=s[i]
       i=i+1
   print(f"{empty}...")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

S_num = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(s) <= k:
    print(s)
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:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
def inNL(n):
    return [list(map(int,input().split())) for i in range(n)]
k = inN()
s = input()
l = len(s)
if k >= l:
    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:
    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:
'''
問題：
    英小文字からなる文字列 S があります。

    S の長さが K 以下であれば、Sをそのまま出力してください。
    S の長さが K を上回っているならば、先頭 K 文字だけを切り出し、
    末尾に ... を付加して出力してください。
'''

'''
制約：
    K は 1 以上 100 以下の整数
    S は英小文字からなる文字列
    S の長さは 1 以上 100 以下
'''

# 標準入力からK, S を取得する
k = int(input())
s = str(input())

result = ""
if len(s) <= k:
    result = s
else:
    for i in range(0, k):
        result += s[i]
    result += "..."

print(result)

Submission status: Accepted

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

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

print(S)

Submission status: Accepted

Solution code:
# B - ... (Triple Dots)
# K
K = int(input())
# S
S = input()

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

print(answer)

Submission status: Accepted

Solution code:
if __name__ == '__main__':

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

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

size = len(S)

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

Submission status: Accepted

Solution code:
K = int(input())
S=input()
S1 = list(S)
S2 = len(S1)

if S2 <= K:
    print(S)

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

Submission status: Accepted

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

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

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

if len(s) <= k: # Sの長さがKまで。K:＝Kまで。
     print(s)
else:
    s = s[:k]
    s = s+"..."
    print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

K = int(x)

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

Submission status: Accepted

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

i = len(S)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 英小文字からなる文字列Sがあります。
# Sの長さがK以下であれば、Sをそのまま出力してください。
# Sの長さがKを上回っているならば、先頭K文字だけを切り出し、末尾に ... を付加して出力してください。

# k(Sの長さ）,S（文字列）：標準入力
k = int(input())
s = input()

def length(k: int, s:str) -> str:
    if len(s) <= k:
        return s
    else:
        return s[:k] + '...'  # 文字列：Sから先頭からk文字目を切り取る → s[:k]：最終位置のみ記述

print(length(k ,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()

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





#########他人のコピー#########


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

#########他人のコピー#########

Submission status: Accepted

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

Submission status: Accepted

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

if n >= len(kekw):
    print(kekw)
elif n < len(kekw):
    kekwlist = list(kekw)
    for i in range(0, n):
        print(kekwlist[i], end = "")
    print("...")

Submission status: Accepted

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

# 英小文字からなる文字列 S があります。
# S の長さが K 以下であれば、 S をそのまま出力してください。
# S の長さが K を上回っているならば、先頭 K文字 だけを切り出し、末尾に ... を付加して出力してください。

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) >= 0:
    print(S)
else:
    print("{}...".format(S[0:K]))

Submission status: Accepted

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

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

Submission status: Accepted

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

if k >= len(s):
    print(s)
elif k <= len(s):
    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:
#168b
#値を受け取る
K = int(input())
S = str(input())

#Kになるまで文字を取り、K以降の文字列は'…'で表す
def answer(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[:K] + '...'


print(answer(K, S))

Submission status: Accepted

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

def answer(K: int, S:str) ->str:
    if len(S) <= K:
        return S
    else:
        return S[:K]+'...'

print(answer(K,S))

Submission status: Accepted

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

def answer(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[:K]+ '...'

print(answer(K, 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:
length=int(input())
s=input()
string = ""
if len(s) <= length:
    print(s)

else:
    for i in range(0,length):
        string += s[i]
    string +="..."

    print(string)

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

if len(A) <= N:
  print(A)
else:
  print(A[:N] + '...')

Submission status: Accepted

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

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

Submission status: Accepted

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

s_l = len(S)
s_k = list(S)
answer = s_k[slice(0, K)]
result = ''.join(answer)

if s_l <= K:
    print(S)

else:
    print(result + '...')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# sの文字数がkより小さければそのまま出力
if len(s) <= k:
    print(s)
# そうでなければk文字目までと・・・を出力
else:
    print(s[0:k] + "...")

Submission status: Accepted

Solution code:
# Kは1以上100以下の整数
# 英小文字からなる文字列 S
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())

s = "".join(S[:K])
c = len(S)

if K >= c:
    print(s)
else:
    answer = s + "..."
    print(answer)

Submission status: Accepted

Solution code:
S_list = [input() for i in range(2)]
K = int(S_list[0])
S = S_list[1]
n = len(S)
if n <= K:
    result = S
else:
    S = S[:K] + "..."
    result = S
print(result)

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:
# 英小文字からなる文字列　S
# 入力される整数 K
# S の長さが K以下であれば、S をそのまま出力
# S の長さが Kをうわまってるならば、先頭K文字だけを切り出し、末尾に'...'を付加して出力
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:
    s = s[:k] + '...'
    print(s)

Submission status: Accepted

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

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

else:
    print(S)

Submission status: Accepted

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

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


else:
    print(S)

Submission status: Accepted

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

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

else:
    print(S)

Submission status: Accepted

Solution code:
# 英小文字からなる文字列Sの文字数と数値Kを比較して出しわけ
# →S>Kなら K文字目までのS+...を出力、それ以外はそのまま

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

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

print(S)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#Kは整数
#Sは文字列

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

SK = S[0: (K)]

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

Submission status: Accepted

Solution code:
# abc168b
# https://atcoder.jp/contests/abc168/tasks/abc168_b

# Sの文字列の長さがK以下であれば、
# そのままSを出力
# K以上であれば、Kの文字列と'...'を付加して出力

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

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

Submission status: Accepted

Solution code:
break_line = int(input())
word = input()

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if len(moji) <= N:
    print(moji)
else:
    print(moji[:N] + "...")

Submission status: Accepted

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

SK = S[0 : (K)]

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

Submission status: Accepted

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

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

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:
def answer(k: int, s: str) -> str:
    return s if len(s) <= k else s[:k] + '...'


def main():
    k = int(input())
    s = input()
    print(answer(k, s))


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

S_num = len(S)

if K >= S_num:
    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 = str(input())

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

Submission status: Accepted

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

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

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

def answer(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[:K]+ '...'

print(answer(K, S))

Submission status: Accepted

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

len_S = len(S)

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

Submission status: Accepted

Solution code:

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

S_num = len(S)

if K >= S_num:
    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(str())

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

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:
# 168_b
K = int(input())
S = input()
# str.islower()
# >文字列中の大小文字の区別のある文字全てが小文字で、
# >かつ大小文字の区別のある文字が 1 文字以上あるなら True を、そうでなければ False を返します。

if (1 <= K and K <= 100) and S.islower() and (1 <= len(S) and len(S) <= 100):
    if len(S)<=K:
        print(S)

    elif len(S)>K:
        print("{}...".format(S[0:K]))

Submission status: Accepted

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


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

Submission status: Accepted

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

# 文字列Sの長さがK以下ならSをそのまま出力
# Kより長いならば、先頭K文字を切り出し、末尾に...をつけて出力

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

len_S = len(S)

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

Submission status: Accepted

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


def result(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        answer = S[:K]
        return answer + '...'

print(result(K, S))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

len_s = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
def result(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        answer = S[:K]
        return answer + '...'
print(result(K, S))

Submission status: Accepted

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

def answer(a:int,b:str):
    if len(b)<=a:
        return(b)
    else:
        return (b[0:a]+"...")

print(answer(K,S))

Submission status: Accepted

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

n = len(S)
list_S = list(S)

if n > K:
    tmp = list_S[0:K]
    print(''.join(tmp) + '...')
else:print(''.join(list_S))

Submission status: Accepted

Solution code:
K = int(input())
S = input()
def result(K: int, S: str) -> str:
    s_len = len(S)
    if s_len <= K:
        return S
    else:
        answer = ''
        i = 0
        while i <= K-1:
            answer += S[i]
            i += 1
        answer += '...'
        return answer
print(result(K, S))

Submission status: Accepted

Solution code:
# B - ... (Triple Dots)
# https://atcoder.jp/contests/abc168/tasks/abc168_b

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

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

Submission status: Accepted

Solution code:
S = int(input())

K = input()

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

Submission status: Accepted

Solution code:
K = int(input())
S = input()
if len(str(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 :
    ans=str()
    for i in range(k):
        ans+=s[i]
    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:
# 168 B
K = int(input())
S = input()
if len(str(S)) <= K:
    print(S)
else:
    print(S[:K]+'...')

Submission status: Accepted

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

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

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:

def ac_168b(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[0:K] + "..."

K = int(input())
S = input()
print(ac_168b(K, S))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

length = len(S)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k,s=open(0);k=int(k);print(s[:k]+'...'*(k<~-len(s)))

Submission status: Accepted

Solution code:
k,s=open(0);k=int(k);print(s[:k]+'...'*(-~k<len(s)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 文字の取得
ulim = int(input())
word = str(input())
wcnt = len(word)

# 結果を出力
if wcnt > ulim:
    print(word[:ulim] + "...")
else:
    print(word)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    k = int(input())
    s = input()
    s2 = ""
    if len(s) <= k:
        print(s)
    else:
        for i in range(k):
            s2 += s[i]
        s2 +=("...")
        print(s2)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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:

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

Submission status: Accepted

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

for i in range(num):
    print(word[i],end="")
    if i+1 >= len(word):
        break

if len(word) > num:
    print("...")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(K, S):
    ans = S
    if len(S) <= K:
        return ans
    else:
        return ans[:K] + '...'

if __name__ == '__main__':
    K = int(input())
    S = input()
    ans = main(K, S)
    print(ans)

Submission status: Accepted

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

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:
# ABC168

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l=len(s)

if l<=k:
  print(s)
else:
  s=list(s)
  t=[]
  for i in range(k):
    t.append(s[i])
  t.append('...')
  print(''.join(t))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

N = int(input())

S = input()

strLen = len(S)

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

Submission status: Accepted

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

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- 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 = str(input())
if len(S) > K:
    S_dash = S[0:K]
    S_dash += '...'
    print(S_dash)
else:
    print(S)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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


def main():
    tokens = chain(*(line.split() for line in sys.stdin))
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    answer = solve(K, S)
    print(answer)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

if LS <= IK:
    print(S)

elif LS > IK:
    print(S[0:IK] + '...')

Submission status: Accepted

Solution code:
# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase
 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# ------------------- fast io --------------------
from math import gcd, ceil
 
def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[i - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] = j
    return pi
 
 
def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans
 
def lcm(a, b): return a * b // gcd(a, b)
 
 
def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else "0" * (length - len(y)) + y

K = int(input())
s = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

if len(s) > k:
    print(s[:k], end='')
    print("...")
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 :
  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[:K] + '...')
else:
    print(S)

Submission status: Accepted

Solution code:
# 数値で入力ではなく, 文字列で入力しlist関数を使う
k = int(input())
s = input()
n = len(s)
list_s = list(s)

# リストのスライス機能を使用
if n > k:
    tmp = list_s[0:k]
    print(''.join(tmp) + '...')
else: print(''.join(list_s))