Problem:


Score: 200 points

Problem Statement

We have a string S consisting of lowercase English letters.

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

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

Constraints

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

S is a string consisting of lowercase English letters.

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

Input

Input is given from Standard Input in the following format:

K
S

Output

Print a string as stated in Problem Statement.

Sample Input 1

7
nikoandsolstice

Sample Output 1

nikoand...

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

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

Sample Input 2

40
ferelibenterhominesidquodvoluntcredunt

Sample Output 2

ferelibenterhominesidquodvoluntcredunt

The famous quote from Gaius Julius Caesar.



Sample input:
7
nikoandsolstice


Sample output:
nikoand...

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
maxlen = int(input())
strs = input()
strslen = len(strs)

if maxlen >= strslen:
    print(strs)

else:
    ans = strs[:maxlen]
    ans += "..."
    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:
# -*- coding: utf-8 -*-

###
# main
if(__name__ == '__main__'):
    # input
    k = int(input())
    s = input()

    postfix = ""
    if k < len(s):
        postfix = "..."
    elif len(s) < k:
        k = len(s)

    ans = s[0:k] + postfix

    print(ans)

# else:
    # do nothing

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
K = int(input())
S = input()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
s = input()
l = len(s)
S = s[:k]

if l > k:
    print(S+'...')
else:
    print(s)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
import itertools


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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#8:47
MOD=10**9+7
INT_MAX=10**18+7
def INPUT():return list(int(i) for i in input().split())
def LIST_1D_ARRAY(n):return [0 for _ in range(n)]
def LIST_2D_ARRAY(m,n):return [[0 for _ in range(n)]for _ in range(m)]
def power(a,x):
    res=1
    while(x>0):
        if x&1:
            res=(res*a)%MOD
        a=(a*a)%MOD
        x//=2
    return res%MOD
def NCR_MOD(n,r):
    num=1
    for i in range(n,n-r,-1):num=(num*i)%MOD
    for j in range(1,r+1):num=(num*power(j,MOD-2))%MOD
    return num
#################################################################################
k=int(input())
s=input()
if len(s)<=k:
    print(s)
else:
    print(s[0:k],end="...")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)


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


if __name__ == '__main__':
    main(sys.stdin.readline, print)

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
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation


"""Module docstring
"""

import functools
import heapq
import itertools
import logging
import math
import os
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict, deque
from copy import deepcopy
from io import BytesIO, IOBase
from typing import Dict, List, Optional, Set, Tuple


def solve(k: int, s: str) -> str:
    if len(s) <= k:
        return s
    return "".join((s[:k], ".", ".", "."))


def do_job(stdin, stdout):
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    K = int(stdin.readline().strip())
    S = stdin.readline().strip()
    result = solve(K, S)
    print(result, file=stdout)


def print_output(testcase: int, result, stdout) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result), file=stdout)
    # 6 digits float precision {:.6f} (6 is the default value)
    # print("Case #{}: {:f}".format(testcase + 1, result), file=stdout)


BUFSIZE = 8192


class FastIO(IOBase):
    # pylint: disable=super-init-not-called, expression-not-assigned
    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):
    # pylint: disable=super-init-not-called
    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")


def configure_log() -> None:
    "Configure the log output"
    log_formatter = logging.Formatter("L%(lineno)d - " "%(message)s")
    handler = logging.StreamHandler(IOWrapper(sys.stderr))
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    stdin = IOWrapper(sys.stdin)
    stdout = IOWrapper(sys.stdout)
    do_job(stdin, stdout)
    stdout.flush()
    for h in LOG.handlers:
        h.flush()
    return 0


if __name__ == "__main__":
    sys.exit(main())

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    K = int(input())
    S = input().strip()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
k = int(sys.stdin.readline().rstrip("\n"))
s = sys.stdin.readline().rstrip("\n")
if len(s) > k:
    print(s[:k]+'...')
else:
    print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    K = int(stdin.readline().rstrip())
    S = stdin.readline().rstrip()
    print(S if len(S) <= K else f'{S[:-(len(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[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 numpy as np
import math

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 K>=len(S):
    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:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

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 = str(input())
ans = []
for i in range(min(K,len(S))):
    ans.append(S[i])
if len(S) > K:
    ans.append('...')
print(''.join(ans))

Submission status: Accepted

Solution code:
def main():
    K = input()
    K = int(K)
    S = input()
    Slen = len(S)
    Sstr = str(S)
    
    if Slen <= K:
        print(Sstr)
    else:
        print(str(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(f'{s[:k]}...')

Submission status: Accepted

Solution code:
k = int(input())
s = input()
L = len(s)
if L <= 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()

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)
  exit()
  
else:
  for i in range(K):
    print(S[i], end="")
print("...")

Submission status: Accepted

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

Submission status: Accepted

Solution code:


k = 0
s = ''

def format_input(filename = None):
	global k
	global s
	if filename == None:
		k = int(input())
		s = str(input())

	elif filename == '__random__':
		from random import randint as rng
		from random import choices
		k = rng(1, 10**2)
		s = ''.join(choices('abcdefghijklmnopqrstuvwxyz', k = rng(1, 10**2)))
		print(k)
		print(s)

def get_answer():
	answer = ''

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

	return answer

if __name__ == '__main__':
	format_input()

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


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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))
if __name__ == "__main__":
    k = I()
    s = S()
    str =  s[:k] + "..."
    print(s if len(s) <= k else str)

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

ans = s[:k]

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

print(ans)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
k = int(input())
s = input()
if len(s) <= 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:
    t=s[0:k]+'...'
    print(t)

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

# print(K, S)

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

Submission status: Accepted

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

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

else:
    preans = s[:K]
    preans.append("...")
    ans = ""
    for i in preans:
        ans += i
    print(ans)

Submission status: Accepted

Solution code:
def main():
    K = int(input())
    S = input()
    if len(S) <= K:
        print(S)
    else:
        print(S[0:K]+"...")
    #a = list(map(int, input().split()))
    #print(a)
    
    
if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
s = str(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...' % (S[0:K]))

Submission status: Accepted

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

Submission status: Accepted

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

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("...")
    
"""
7
nikoandsolstice
"""

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

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

Submission status: Accepted

Solution code:

from sys import stdin

def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())

k = I()
s = S()

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
 
 
K = int(input())
S = input()
s_list = list(S)
if len(s_list) <= K:
    print(S)
    sys.exit()
else:
    ans = s_list[:K]
    ans.append('...')
    print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os
import bisect, collections, copy, itertools, math, string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int, input().split()))
def LS(): return list(input().split())

def solve():
	k = I()
	s = S()

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

if __name__ == '__main__':
	solve()

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

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

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())
l = len(s)
ans = s

if l <= k:
    print(ans)
else:
    b = '.'*3
    ans = s[:k]+b
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K = int(input())
S = str(input())
if len(S) <= K:
    print("".join(S))
else:
    print("".join(S[: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 = 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:
K = int(input())
S = input()

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

output = ""

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

print(output)

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

if len(s) <= k:
    print("".join(s))
    sys.exit()

else:
    x = []
    for i in range(k):
        x.append(s[i])
    x.append("...")
    print("".join(x))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

if (k >= len(s)):
    print(s)
else:
    kotae = []
    for i in range(k):
        kotae.append(s[i])
    kotae.append("...")

    kotae2 = "".join(kotae)
    print(kotae2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#import numpy as np
#a,b,c=map(int,input().split())
z=int(input())
a=input()
if len(a)>z:
    b=a[:z]
    print(b+"...")
else:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t=input()
s=len(t)

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

Submission status: Accepted

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

s_l = len(s)

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

Submission status: Accepted

Solution code:
import sys, re
import math
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul	# 
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd	# 最大公約数
from heapq import heappush, heappop

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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

# -*- coding: utf-8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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

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

if s_l > k:
    s = s[:k]
    s = f'{s}...'

print(s)

Submission status: Accepted

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

if len(s) <= k:
    print(s)
else:
    diff = len(s) - k
    s = s[: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 k>=len(s):
  print(s)
else:
  sList=list(s)
  t=[]
  for i in range(k):
    t.append(sList[i])
    
  T=''.join(t)
  print(T+'...')

Submission status: Accepted

Solution code:

a=int(input())
b=input()

c=len(b)

if c>a:
    print(b[:a]+"...")

else:
    print(b)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
K = int(input())
S = str(input())

L_S = len(S)

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

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

Submission status: Accepted

Solution code:
#a=input()
K = int(input())
S = input()
#a,b=map(int,input().split(" "))
#a=[int(_) for _ in input().split(" ")]

ans = ""

if K >= len(S):
    ans = S
else:
    for i in range(K):
        ans += S[i]
    ans += "..."

#print(a,b)
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:
# -*- coding: utf-8 -*-
K = int(input())
S = input()
a = ""
if len(S) > K:
    for i in range(K):
        a+=S[i]
    a+="..."
    print(a)
else:
    print(S)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import re
import copy

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

Submission status: Accepted

Solution code:
n = int(input())

m = input()

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

Submission status: Accepted

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

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