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

if( len(s) > k ):
  s = s[0:k] + '...'
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:
input_1=input()
input_2=input()
#print(input_1)
#print(input_2)
    
length = len(input_2)
#print(length)

if int(length) <= int(input_1):
    print(input_2)
else:
    print(input_2[:int(input_1)]+"...")

Submission status: Accepted

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

slen = len(s)

if k >= slen:
    result = s
else:
    result = s[:k] + "..."
    
print(result)

Submission status: Accepted

Solution code:
k = int(input())
s = str(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()
print(s) if len(s) <= k 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 = 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:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *					# ll = deepcopy(l)
from heapq import *					# heappush(hp,x)
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize				# minn = -maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *				# pre = [0] + list(accumulate(l))
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''
40
ferelibenterhominesidquodvoluntcredunt
'''

def solve(l,k):
	n = len(l)
	if(n <= k):
		return l
	else:
		return l[:k] + '...'

N = int(stdin.readline())
l = input()
ans = solve(l,N)
print(ans)

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

max_int = 1000000001  # 10^9+1
min_int = -max_int

n = int(sys.stdin.readline())
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

## Library

from fractions import gcd
import math
from math import ceil,floor
import collections

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# list = list(map(int, input().split()))

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

## Logic

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

## output

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(4100000)


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
k = input()
s = input()
i = 0
l = int(k)
p = str()
 
while i < l and len(s) > l:
    p = p + s[i]
    i = i + 1
while i < len(s) and len(s) <=l:
    p = p + s[i]
    i = i + 1
if len(s) > l:
	print(p + '...')
else:
	print(p)

Submission status: Accepted

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

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

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

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:
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

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

K=one_int()
S=one_str()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
k=int(input())
s=input()
l=len(s)
ans=''
for i in range(k):
  ans+=s[i]
  if i==l-1:
    break
else:
  ans+='...'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

S = input()

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

Submission status: Accepted

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


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
k = int(input())
s = 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],end="...")

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 = len(S)

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

Submission status: Accepted

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

if int(K) < len(S):
    print(S[0:int(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()

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

Submission status: Accepted

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

#calc
xs=len(s)

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

Submission status: Accepted

Solution code:
k = int(input().rstrip())
s = list(input().rstrip())

def print_len(k,s):
    for i in range(min(k,len(s))):
        print(s[i],end="")
    if len(s)-k > 0:
        print('...',end="")
    print()
    
print_len(k,s)

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

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

Submission status: Accepted

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

S = len(S_str)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

else:
    print(s[0:int(k)] + '...')

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# atcoder 
# Türkçe konuşyorum
# Türkler var mı
# memnün oldum

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



if(len(S) <= K):
    print(S)
else:
    print(S[:K] + '.' * 3)
    #for i in range(3):
    #    change = change.replace(change[i], '.')
    #print(S[:K] + change[:3])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = list(input())
S2 = [0] * K

if len(S) <= K:
    print(''.join(S))
else:
    for i in range(K):
        S2[i] = S[i]
    S2.append('...')
    print(''.join(S2))

Submission status: Accepted

Solution code:
def main():
    K = int(input())
    S = input()
    if len(S) <= K:
        print(S)
    else:
        print(f"{S[:K]}...")

    return


if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

else:
    word=S

print(word)

Submission status: Accepted

Solution code:
k = int(input())
s = input()
if len(s) > k:
    res = ''
    for char in list(s):
        if len(res) >= k:
            break
        res += char
    print(res + '...')
else:
    print(s)

Submission status: Accepted

Solution code:
d = int(input())
str_d = input()

if d < len(str_d):
  print(str_d[:d] +'...')
else:
  print(str_d)

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy
from __future__ import division, print_function
from collections import defaultdict, Counter, deque
from future_builtins import ascii, filter, hex, map, oct, zip
from itertools import imap as map, izip as zip, permutations, combinations, combinations_with_replacement
from __builtin__ import xrange as range
from math import ceil, factorial, log,tan,pi
from _continuation import continulet
from cStringIO import StringIO
from io import IOBase
import __pypy__
from bisect import bisect, insort, bisect_left, bisect_right
from fractions import Fraction
from functools import reduce
import string
import sys
import os
import re
inf = float('inf')
mod_ = int(1e9) + 7
mod = 998244353

def factors(n):
    from functools import reduce
    return set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def sieve(m):
    n=1
    primes = {}
    arr=set([])
    for i in range(2, int(m ** 0.5) + 1):
        a = n // i
        b = m // i
        for k in range(max(2, a), b + 1):
            c = i * k
            primes[c] = 1

    for i in range(max(n, 2), m + 1):
        if i not in primes:
            arr.add(i)

    return arr


class DisjointSetUnion:
    def __init__(self, n):
        self.parent = list(range(n))
        self.size = [1] * n
        self.num_sets = n
 
    def find(self, a):
        acopy = a
        while a != self.parent[a]:
            a = self.parent[a]
        while acopy != a:
            self.parent[acopy], acopy = a, self.parent[acopy]
        return a
 
    def union(self, a, b):
        a, b = self.find(a), self.find(b)
        if a != b:
            if self.size[a] < self.size[b]:
                a, b = b, a
 
            self.num_sets -= 1
            self.parent[b] = a
            self.size[a] += self.size[b]
 
    def set_size(self, a):
        return self.size[self.find(a)]
 
    def __len__(self):
        return self.num_sets

def isprime(t):
    for i in range(2,int(t**0.5)+1):
        if t%i==0:
            return False
    return True
def semiprime(x):
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            if isprime(i) and isprime(x//i) and i!=x//i:
                return True
    return False
    


def main():

    # y**2=N+i**2
    # N=(y-i)*(y+i)

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



        

        
    




    



# region fastio

BUFSIZE = 8192

class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

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


class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()


def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# ABC168B

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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


if(len(s) <= k):
	print(s)
else:
	cnt = 0
	a = ""
	for i in s:
		a += i
		cnt += 1
		if cnt == k:
			break
	print(a + "...")

Submission status: Accepted

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

len_S = len(S)

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

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

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

print(S)

Submission status: Accepted

Solution code:
import sys
K = int(input())
S = str(input())
if len(S) > K:
    for i in range(K):
        sys.stdout.write(S[i])
    print('...')
else:
    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:
mo1=int(input())
mo2=input()

if mo1<len(mo2):
    print(mo2[0:mo1]+"...")
    pass
else:
    print(mo2)

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

#n, m = [int(ii) for ii in raw_input().split()]
k = int(input())
s = input()
solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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


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

else:
    print(K)

Submission status: Accepted

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

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

Submission status: Accepted

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

if len(S)>N:
  newS=S[:N]
  newS+="..."
  print(newS)

else:
  print(S)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
K = int(input())
S = str(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(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:
import sys
#a = []
#for l in sys.stdin:
#    a.append(int(l))
k = int(input())
s = input()
if len(s) <= k:
   print(s)
else:
   for i in range(k):
      print(s[i], end="")
   for i in range(3):
      print('.', end="")

Submission status: Accepted

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


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(s if len(s)<=k else s[0: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:
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()

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

Submission status: Accepted

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


def solve(K: int, S: str):
    if len(S) <= K:
        print(S)
    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:
import sys, os

if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

f = lambda:list(map(int,input().split()))

def get_qsa(file_name):
    audio, size = readfile(file_name)
    headers = {
        'Connection': 'keep-alive',
        'Content-Length': str(size)
    }

    
    parameter = {
                "request_id":int(time.time()*100),
                "th":1,
                "tht":"qf492_100fps",
                "the":1.000000,
                "thst":"neural"
                }
    res = requests.post(f"http://{config['ip']}:{config['port']}", timeout=120, data=audio, headers=headers, params = parameter)
    # print(res.url)

    res_json = res.json()
    # print(res_json.keys())


    if res_json['retmsg']!="success":
        raise Exception
    

    bin_str = res_json["th"][0]["feat"]
    bin_data = base64.b64decode(bin_str)

    bin2qsa_siren(bin_data, file_name)


def solve():
    n = f()[0]
    s = input()

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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:
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    K = int(input())
    S = str(input())

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

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()

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

while not 1 <= k <= 100:
    print('out of range! enter again')
    k = int(input(''))

while not s.islower():
    print('must be lowercase! enter again')
    s = str(input(''))
    
if k >= len(s):
    print(s)

else:
    out = s[:k] + '...'
    print(out)

Submission status: Accepted

Solution code:

#168 B
K = int(input())
S = input()

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


#168 A
#n_last = int(list(input())[-1])

#if n_last in [3]:
#	print('bon')
#elif n_last in [0,1,6,8] :
#	print('pon')
#else:
#	print('hon')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#整数kを入力
k = int(input())
#文字列sを入力
s = input()
#sの長さを判定
if len(s) <= k:
  print(s)
else:
  print(s[:k]+'...')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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:
import sys
from io import StringIO
import unittest

def resolve():

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

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

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