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:

from math import radians
from heapq import heapify, heappush, heappop
import bisect
from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
# from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
# from bisect import bisect_left,bisect_right
# from decimal import *,threading
from fractions import Fraction
mod = int(pow(10, 9)+7)
# mod = 998244353


def ii(): return int(input())


def si(): return str(input())


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


def li1(): return list(mi())


def fii(): return int(stdin.readline())


def fsi(): return str(stdin.readline())


def fmi(): return map(int, stdin.readline().split())


def fli(): return list(fmi())


abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}


def getKey(item): return item[0]


def sort2(l): return sorted(l, key=getKey)


def d2(n, m, num): return [[num for x in range(m)] for y in range(n)]


def isPowerOfTwo(x): return (x and (not (x & (x - 1))))


def decimalToBinary(n): return bin(n).replace("0b", "")


def ntl(n): return [int(i) for i in str(n)]


def powerMod(x, y, p):
    res = 1
    x %= p
    while y > 0:
        if y & 1:
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res


graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000


def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)


def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d:
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d:
            d[y] = [x]
        else:
            d[y].append(x)
    return d


def gr2(n):
    d = defaultdict(list)
    for i in range(n):
        x, y = mi()
        d[x].append(y)
    return d


def connected_components(graph):
    seen = set()

    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component

    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans


def primeFactors(n):
    s = set()
    while n % 2 == 0:
        s.add(2)
        n = n // 2
    for i in range(3, int(sqrt(n)) + 1, 2):
        while n % i == 0:
            s.add(i)
            n = n // i
    if n > 2:
        s.add(n)
    return s


def find_all(a_str, sub):
    start = 0
    while True:
        start = a_str.find(sub, start)
        if start == -1:
            return
        yield start
        start += len(sub)


def SieveOfEratosthenes(n, isPrime):
    isPrime[0] = isPrime[1] = False
    for i in range(2, n):
        isPrime[i] = True
    p = 2
    while (p * p <= n):
        if (isPrime[p] == True):
            i = p * p
            while (i <= n):
                isPrime[i] = False
                i += p
        p += 1
    return isPrime


def dijkstra(edges, f, t):
    g = defaultdict(list)
    for l, r, c in edges:
        g[l].append((c, r))

    q, seen, mins = [(0, f, ())], set(), {f: 0}
    while q:
        (cost, v1, path) = heappop(q)
        if v1 not in seen:
            seen.add(v1)
            path = (v1, path)
            if v1 == t:
                return (cost, path)

            for c, v2 in g.get(v1, ()):
                if v2 in seen:
                    continue
                prev = mins.get(v2, None)
                next = cost + c
                if prev is None or next < prev:
                    mins[v2] = next
                    heappush(q, (next, v2, path))
    return float("inf")


def binsearch(a, l, r, x):
    while l <= r:
        mid = l + (r-1)//2
        if a[mid]:
            return mid
        elif a[mid] > x:
            l = mid-1
        else:
            r = mid+1
    return -1


# def input():
#    return stdin.buffer.readline()


def readTree(n):
    adj = [set() for _ in range(n)]
    for _ in range(n-1):
        u, v = map(int, input().split())
        adj[u-1].add(v-1)
        adj[v-1].add(u-1)
    return adj


def treeOrderByDepth(n, adj, root=0):
    parent = [-2] + [-1]*(n-1)
    ordered = []
    q = deque()
    q.append(root)
    depth = [0] * n
    while q:
        c = q.popleft()
        ordered.append(c)
        for a in adj[c]:
            if parent[a] == -1:
                parent[a] = c
                depth[a] = depth[c] + 1
                q.append(a)
    return (ordered, parent, depth)


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

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

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

Submission status: Accepted

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

def input_one_number():
    return int(input())

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

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

K = input_one_number()
S = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
k = int(input())
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import re
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
from functools import reduce


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


def ZIP(n): return zip(*(MAP() for _ in range(n)))


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

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(f"{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:
def main():
    import sys
    K=int(sys.stdin.readline())
    S=sys.stdin.readline().strip()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Fall 7, Stand 8...
# !/ankit_SM/bin/env python
from __future__ import division, print_function
import os;
import sys;
from io import BytesIO, IOBase
import math
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def main():
    k=int(input())
    s=str(input())
    if(k<len(s)):
        print(s[:k],end="...")
    else:
        print(s)





# region fastio
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd,
                        max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(
                b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd,
                        max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(
                b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    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()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(
        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()
n = len(s)
if n <= k:
    print(s)
else:
    print(s[:k] + '...')

Submission status: Accepted

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

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

else:
    print(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 = input()
N = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
	k = int(input())
	s = str(input())
	if len(s) <= k:
		print(s)
	else:
		print("{}...".format(s[:k]))





if __name__ == '__main__':
	main()

Submission status: Accepted

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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


input = sys.stdin.readline
def IS(cb): return cb(input().strip())
def IL(cb): return [cb(s) for s in input().strip().split()]
def IR(cb, rows): return [IS(cb) for _ in range(rows)]
def ILL(cb, rows): return [IL(cb) for _ in range(rows)]


def solve():
    K = IS(int)
    S = IS(str)
    if len(S) <= K:
        print(S)
    else:
        print(S[:K] + '...')


solve()

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 sys
import math 
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:
        ans = s
else:
        ans = s[0:k]
        ans +='...'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    k = int(input())
    s=input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    K = gete(int)
    S = gete()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=int(input())
import sys
s=input()
t=''
if len(s)<=k:
    print(s)
    sys.exit()
else:
    for i in range(k):
        t+=s[i]
for i in range(3):
    t+="."
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:
# -*- coding: utf-8 -*-
"""
Created on Sun May 17 20:56:22 2020

@author: Kanaru Sato
"""

k = int(input())
s = list(input())
n = len(s)

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

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

Submission status: Accepted

Solution code:
import itertools
import sys
import numpy as np
import collections


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

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:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

k=getN()
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("{}...".format(S[:K]))

Submission status: Accepted

Solution code:
K = int(input())
S = input()
# N, M = map(int, input().split())
# X = [[] for _ in range(N)]
# for i in range(N):
#     X[i] = list(map(int, input().split()))

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

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 bisect
import collections
import functools
import heapq
import math
from collections import deque
from collections import defaultdict
MOD = 10**9+7

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

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

# import re
# import math
import collections
# import decimal
# import bisect
# import itertools
# import fractions
# import functools
import copy
# import heapq
# import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
MOD2 = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    k = ni()
    s = input()
    l = len(s)

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import time
startTimeProblem=time.time()

import fileinput, sys, itertools, functools
from math import *
from bisect import *
from heapq import *
from collections import *

def lcm(a, b):  
    return (a*b)/gcd(a, b)

class InputHelper:
    def __init__(self):
        self.myinput = fileinput.input()

    def isLocal(self):
        return not fileinput.isstdin()

    def int(self):
        return int(self.myinput.readline().rstrip())

    def ints(self):
        return [int(_) for _ in self.myinput.readline().rstrip().split()]

    def str(self):
        return self.myinput.readline().rstrip()

    def strs(self):
        return [_ for _ in self.myinput.readline().rstrip().split()]

class OutputHelper:
    def int(self, a):
        print(a)    

    def ints(self, a):  
        print(" ".join([str(_) for _ in a]))
    
    def intsNL(self, a):
        for _ in a:
            print(_)
    
    def str(self, s):
        print(s)

    def strs(self, s):
        print(" ".join([_ for _ in s]))

    def strsNL(self, s):
        for st in s:
            print(st)

class ListNode:
    def __init__(self, val):
        self.val = val
        self.next = None
        self.prev = None

In = InputHelper()
Out = OutputHelper()

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

K = In.int()
S = In.str()

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

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

if len(sys.argv)>2 and sys.argv[2]=="TIMEIT":
    fin = (time.time()-startTimeProblem)*1000
    print("{:.2f}".format(fin) + "ms")

Submission status: Accepted

Solution code:
# B - 

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

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

Submission status: Accepted

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    #n,m,k=map(int, readline().rstrip().split())
    #arr=list(map(int, readline().rstrip().split()))
    k=int(readline())
    ss=readline().rstrip()
    if len(ss) <= k:
        print(ss)
    else:
        print(ss[0:k]+"...")
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

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:
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('{}...'.format(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:
k=int(input())
s=str(input())
if len(s)<=k:
    print(s)
else:
    ss=s[:k]
    print(ss+'...')

Submission status: Accepted

Solution code:
def main():
    k = int(input())
    s = list(input())
    if k >= len(s):
        print(''.join(s))
        return
    ans = ''.join(s[:k])
    ans += '...'
    print(ans)
if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
from copy import copy, deepcopy
from collections import Counter
from math import sqrt, floor, factorial
from itertools import permutations, combinations, combinations_with_replacement
from operator import mul
from functools import reduce
import bisect

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

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

def file_input():
    f = open('ABC168/input.txt', 'r')
    sys.stdin = f

def main():
    if os.getenv("ENV")=='LOCAL':
        file_input()

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

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

if __name__ == '__main__':
    main()

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[:K:]+"...")

Submission status: Accepted

Solution code:
k=int(input())
s=input()
l=list(s)
n=len(l)
l1=[]
if n<=k:
    print(s)
else:
    for i in range(k):
        l1.append(l[i])
    l1.append(".")
    l1.append(".")
    l1.append(".")
    print("".join(l1))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
import collections
import heapq

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

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

Submission status: Accepted

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

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