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:
def task(k, s):
    if len(s) <= k:
        print(s)
    else:
        print(s[0:k] + '...')


k = int(input())
s = input()
task(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 k >= len(s):
  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:
    a = S[0:K]
    b = "..."
    print(a+b)

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np


def inputs(func=lambda x: x, sep=None, maxsplit=-1):
	return map(func, sys.stdin.readline().split(sep=sep, maxsplit=maxsplit))

def input_row(n : int, type=np.int, **kwargs):
	return np.fromiter(inputs(type, **kwargs), dtype=type)

def input_2d(nrows : int, ncols : int, type=np.int, **kwargs):
	data = np.zeros((nrows, ncols), dtype=type)
	for i in range(nrows):
		data[i, :] = input_row(ncols, type, **kwargs)
	return data


K, = inputs(int)
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:
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_list = list(s)
if len(s_list) <= k:
    print(s)
else:
    s_k = ''.join(s_list[0:k])
    print(s_k + '...')

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

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

SL=len(S)

if(SL<=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[0:K]+'...')

Submission status: Accepted

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

mylen = len(S)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# 2020/05/17
# AtCoder Beginner Contest 168 - B

# Input
k = int(input())
s = input()

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

# Output
print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import deque
import bisect
import math
import itertools
from queue import deque
from math import gcd

INF = float('inf')
mod = 10**9+7
eps = 10**-7


def inp(): return int(sys.stdin.readline())


def inp_list(): return list(map(int, sys.stdin.readline().split()))


def lcm(x, y): return (x * y) // gcd(x, y)


K = inp()
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

length = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

Solution code:
K = int(input())

S = input()

if len(S) <= K:
    print(S)
else:
    print("{}...".format(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:
N = int(input())
s = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

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

K=II()
S=SR()

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

Submission status: Accepted

Solution code:
N = int(input())
s = input()
l = list(s)
if len(l) <= N:
    print(s)
else:
    ans = ""
    for i in range(N):
        ans += l[i]
    ans += "..."
    print(ans)

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
from collections import defaultdict

def main():
    n = int(sys.stdin.readline())
    k = input()
    if len(k) > n:
        print(k[:n],end="")
        print("...")
    else: print(k)
    return 0

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    from sys import stdin
    k = int(stdin.readline().rstrip())
    s = stdin.readline().rstrip()
    if len(s)<=k:
        print(s)
    else:
        ans = s[:k]+"..."
        print(ans)
main()

Submission status: Accepted

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

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

Submission status: Accepted

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

s = len(S)

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

Submission status: Accepted

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

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

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], "...", sep="")

Submission status: Accepted

Solution code:

def q2():
    K = int(input())
    S = input()
    
    if len(S) <= K:
        print(S)
        return

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

q2()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = list(input())
etc = ["..."]

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:

K = int(input())

N = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = eval(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...' %(s[:k]))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

k=int(input())
S=input()

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(s) <= k: exit(print(s))
j = len(s) - k
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:
# from math import factorial,sqrt,ceil #,gcd
# from itertools import permutations,combinations,combinations_with_replacement
# from collections import deque,Counter
# import re
# from bisect import bisect_left
# from heapq import heappush,heappop
# from numba import njit
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from fractions import gcd

# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb,perm #permはnPk

# slist = "abcdefghijklmnopqrstuvwxyz"
MOD = 10**9 + 7
K = int(input())
S = input()

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

# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

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


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

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

Submission status: Accepted

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

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

if __name__=="__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k = int(input())

n = input()

l = len(n)

if l>k:
    print(str(n[:k]),end = "")
    print("...")
else:
    print(str(n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
n = input()
l = len(n)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

t = ''
if len(S) > K:
    t = '...'

print(S[:K] + t)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(S) <= K:
    ans = ''
    for i in range(len(S)):
        ans += S[i]
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)
else:
    sk=s[0:k]
    print(sk+'...')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

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

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], '...', sep='')

Submission status: Accepted

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

k = int(input())
s = input()
print(dots(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:
# coding: utf-8
# Your code here!

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

k = int(input())
s = input().strip()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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)
s = list(S)
if l <= K:
  print(S)
else:
  print("".join(s[0:K]) + "...")

Submission status: Accepted

Solution code:

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

n = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
#a, b = map(int, input().split())
#x, y, z = map(int, input().split())
#a, b, c, d = map(int, input().split())
#arr = list(map(int, input().split()))
s = input()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

def resolve():
    K = int(input())
    S = input()
    s_L = len(S)

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

if __name__ == "__main__":
    resolve()

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

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

Submission status: Accepted

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


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


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

    if len(s) <= k:
        return s

    return s[:k] + "..."


if __name__ == "__main__":
    print(main())

Submission status: Accepted

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

if len(s)<=k:
    ans=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)
else:
    a = "".join(S[0:K])
    print(a+"...")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    K = int(input())  # 文字列または整数(一変数)
    S = input()

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

    print(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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 = 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],end='')
    print('...')

Submission status: Accepted

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

# output
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:
import sys
import math


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

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict,Counter

sys.setrecursionlimit(10**7)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    k=ii()
    s=input()
    print(s if len(s)<=k else 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)


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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#n = int(input())
#l = list(map(int, input().split()))

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''
k=int(input())
s=input().rstrip("\n")
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()
n = len(s)
if n <= 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:
    s=s[:k]+'...'
    print(s)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
def solve():
  k = int(input())
  s = input()
  le = len(s)
  if le <= k:
    print(s)
  else:
    print(s[0:k]+"...")
  return 0
 
if __name__ == "__main__":
  solve()

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

Submission status: Accepted

Solution code:
# @oj: atcoder
# @id: hitwanyang
# @email: 296866643@qq.com
# @date: 2020-05-17 20:03
# @url:
import sys,os
from io import BytesIO, IOBase
import collections,itertools,bisect,heapq,math,string
# region fastio

BUFSIZE = 8192

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")
# ------------------------------
def main():
    k=int(input())
    s=str(input())
    if k>=len(s):
        print (s)
    else:
        print (s[0:k]+"...")
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:
N=int(input())
l=input()
if len(l) > N:
   print(l[:N]+"...")
else:
   print(l)

Submission status: Accepted

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

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

Submission status: Accepted

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