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-----
7
nikoandsolstice

-----Sample Output-----
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....

Difficulty: introductory

Starter code:

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

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


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

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


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

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

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


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

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

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

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

print(answer(k, s))

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect
#from operator import itemgetter
#from heapq import heappush, heappop
#import numpy as np
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix
#from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
import sys

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
nf = lambda: float(ns())
na = lambda: list(map(int, stdin.readline().split()))
nb = lambda: list(map(float, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

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

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


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

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

import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp

INF = inf
MOD = 1000000007

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

tmp = 0
res = 0

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

print(res)


from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)


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

main()


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

def main() -> None:
    k = int(input())
    s = input()

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

    return


def __starting_point():
    main()

__starting_point()

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

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


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

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

K = int(input())
S = input()
N = len(S)

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

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

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

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

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

SK = S[0: (K)]

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

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


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

K = int(input())
S = input()
T = ""
if(K >= len(S)):
    print(S)
else:
    for i in range(K):
        T += S[i]
    print(T + "...")

#!/usr/bin/env python3

#import
#import math
#import numpy as np
K = int(input())
S = input()

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


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

k = int(input())

s = input()

ans = ""

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

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

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

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


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


num= int(input())
line=input()
lines=list(line)
if len(lines)<=num:
    print(line)
else:
    for i in range(num):
        print(lines[i],end="")
    print("...")
    


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

integer = int(input())
string = input()
if len(string) > integer:
    print(string[:integer] + '...')
else:
    print(string)

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

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

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

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

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

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

K = int(input())
S = input()
characters = len(S)

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

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

s_num = len(S)

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

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

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

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

n=int(input())
txt=input()
# print(type(n))
if len(txt)<=n:
	print(txt)
else:
	print(("%s..."%txt[:n]))


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

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

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

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


K=int(input());S=input();L=len(S);print(S[:min(K,L)]+"..."*(K<L))

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

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

n = int(input())
if n < 1 or n > 100:
    return

n1 = input()

i = len(n1)
if i < 1 or i > 100:
    return

n2 = '...'

if n >= i:
    print(n1)
else:
    print(n1[:n] + n2)

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

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

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

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


#                               #
    # author : samars_diary #
    # 18-09-2020 │ 22:13:22 #
#                               #

import sys, os.path

#if(os.path.exists('input.txt')):
    #sys.stdin = open('input.txt',"r")
    #sys.stdout = open('output.txt',"w")

sys.setrecursionlimit(10 ** 5)

def mod(): return 10**9+7
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))

#print=sys.stdout.write

def solve():
    k=ii();s=i()
    if len(list(s))<=k: print(s)
    else: print(s[:k]+'...')

for _ in range(1):
    solve()

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

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


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

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

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

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


def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(map(int, input().split()))
def i_row(N): return [int(input()) for _ in range(N)]
def i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]

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

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

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


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

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

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

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

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

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

print(s)

cnt = int(input())
string = input()

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

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

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


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

K = int(input())
S = input()
words = int(len(S))

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

else:
    print(S)

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

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

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

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

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

K = int(input())
S = str(input())
SS = str()
i = 0

if len(S) >K:
  for i in range(K):
    SS += S[i]
    i += 1

  print(SS + '...')

else:
  print(S)

k=int(input())
s=list(input())
ss=("").join(s)
S=len(s)
sss=("").join(s[0:k])
if S<=k:
  print(ss)
else:
  print(sss+("..."))

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


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

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


K = int(input())
S = input()
words = int(len(S))

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

else:
    print(S)

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

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

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

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

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

l = len(s)

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


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

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

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

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

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

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

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



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

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


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

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

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


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


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

S_len = len(S)

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

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


N = int(input())
K = str(input())
x = K[:N]

if N < len(K):
    print(x+'...')
else:
    print(x)

K=int(input())
S=input()
N=len(S)

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

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

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

N = int(input())
K = str(input())
x = K[:N]
 
if N < len(K):
    print(x+'...')
else:
    print(x)

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

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

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

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

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

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

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

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

k = int(input())

s = input()

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

print(s)

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

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

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

n = int(input())
li = list(input())
if len(li) > n:
    for i in range(n):
        print(li[i],end="")
    print("...")
else:
    for i in range(len(li)):
        print(li[i],end="")

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