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:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools
import heapq
#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)


def main():
    k=int(input())
    s=list(input())
    if len(s)>k:
        print("".join(s[0:k])+"...")
    else:
        print("".join(s))




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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    K = int(input())
    S = input()
    n = len(S)
    if n<=K:
        print(S)
    else:
        print(S[:K]+'...')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():

    input = stdin.readline

    K = int(input())
    S = input()[:-1]


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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


N = len(S)

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

K = getN()
S = input()
n = len(S)

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

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

# from math import gcd
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement


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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

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

def map_int_input(): return map(int, input())

MII = map_int_input

def MII_split(): return map(int, input().split())

def MII_to_index(): return map(to_index, input())

def MII_split_to_index(): return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs(): return list(map(int, input()))

LII = list_int_inputs

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

# 2次元リスト化
def LII_2D(rows_number): return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number): return [LII_split() for _ in range(rows_number)]

K = input_int()
S = input()

if len(S) > K:
    S = S[:K]
    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:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq
k = int(input())
#n, k = map(int, sys.stdin.readline().split())
s = input()
#a = list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

def main():
    K = int(input())
    S = readline()[:-1]
    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[0:K]+'...')

Submission status: Accepted

Solution code:
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    K = NI()
    S = SI()

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

Submission status: Accepted

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
# t=int(input())
# for _ in range(t):
#     n,m=map(int,stdin.readline().split())
k=int(stdin.readline())
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 k >= length:
    print(s)
else:
    print(s[:k] + '...')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

    if K >= len(S):
        print(S)
        return

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


resolve()

Submission status: Accepted

Solution code:
import math
import fractions
import collections
import itertools
K=int(input())
S=input()
if len(S)>K:
    print("".join((S[:K],"...")))
else:
    print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! env/bin/local python3
# -*- coding:utf-8 -*-

# -- submit ----

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

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


print(ans)

Submission status: Accepted

Solution code:
k = int(input())

s = input()

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
k = int(input())
n = input()
if len(n) <= k:
    print(n)
else:
    print(n[:k] + "...")

Submission status: Accepted

Solution code:
from collections import defaultdict 
import math
if __name__ == '__main__':
    #s = input().rstrip().split(' ')
    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()
N = len(S)
print(S if K >= N else S[:K] + '...')

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline

    K = int(input())
    S = list(input().rsplit()[0])

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

abc168_b()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""    Arnab Chanda    """

from collections import defaultdict, deque
from itertools import permutations
from sys import stdin,stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
import heapq

int_input=lambda : int(stdin.readline())
string_input=lambda : stdin.readline().split()
multi_int_input =lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input=lambda : list(map(int,stdin.readline().split()))
string_list_input=lambda: list(string_input())
MOD = pow(10,9)+7


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

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:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
# from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, sin, pi, tan
from collections import defaultdict as dd, deque, Counter as C
# from itertools import combinations as comb, permutations as perm
# from bisect import bisect_left as bl, bisect_right as br, bisect
# from time import perf_counter
# from fractions import Fraction

# sys.setrecursionlimit(pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353


def data(): return sys.stdin.readline().strip()


def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var)) + end)


def l(): return list(sp())


def sl(): return list(ssp())


def sp(): return map(int, data().split())


def ssp(): return map(str, data().split())


def l1d(n, val=0): return [val for i in range(n)]


def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


k = int(data())
s = data()
answer = []
t = True
for i in range(len(s)):
    if i + 1 > k:
        t = False
        break
    answer.append(s[i])
if not t:
    answer.append("...")
out(''.join(answer))

Submission status: Accepted

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

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


main()

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n = int(input())
s = input()
if len(s) <= n:
    print(s)
else:
    print(s[:n] + "...")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)


def read():
    K = int(input().strip())
    S = input().strip()
    return K, S


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


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import sys
from math import factorial
from collections import Counter
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

k = INT()
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:
    print("".join(S))
    exit()
ans = S[0:K]+[".",".","."]
print("".join(ans))

Submission status: Accepted

Solution code:
#!python3.8
# -*- coding: utf-8 -*-
# abc168/abc168_b
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    K = i2n()
    S = i2s()
    if len(S) <= K:
        print(S)
    else:
        print(S[:K] + '...')
    return

main()

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

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest


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

    # a, b = map(int, readline().split())
    # l = [list(map(int, readline().split())) for _ in range(n)]

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

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """7
nikoandsolstice"""
        output = """nikoand..."""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """40
ferelibenterhominesidquodvoluntcredunt"""
        output = """ferelibenterhominesidquodvoluntcredunt"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

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

answer = ''
for i, s in enumerate(S):
    if i > K - 1:
        answer += '...'
        break
    else:
        answer += s

print(answer)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import numpy

rl = sys.stdin.readline
k = int(rl())
s = rl().rstrip()
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()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

K = INT()
S = input()

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

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    k = int(input())
    s = input()[:-1].decode()
    if len(s) <= k:
        print(s)
    else:
        print(s[0:k], '...', sep='')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
#a, b = map(int, input().split())
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:
n=int(input())
s=input()
if len(s)<=n:
    print(s)
else:
    print(s[:n]+"...")

Submission status: Accepted

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


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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input = raw_input


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

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

print(out)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
if len(s) > n:
  print("{}...".format(s[:n]))
else:
  print(s)

Submission status: Accepted

Solution code:
K = int(input())
S = input()
# N, A, B = [int(_) for _ in input().split()]
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:1]+"...")

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

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

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    K = ii()
    S = iss()

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


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:
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:
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()
ls = len(s)
if(ls <= 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)