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:
def solve(K, S):
    if len(S) <= K:
        return S
    return S[:K] + "..."

if __name__ == "__main__":
    K = int(input())
    S = input()
    print(solve(K, S))

Submission status: Accepted

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


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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
import sys

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


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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    N = intinput()
    S = input()


    # 出力
    if len(S) > N:
        print(S[:N] + "...")
    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()
a=len(s)
if a<=k:
    print(s)
else:
    b=s[:k]
    print(b+"...")

Submission status: Accepted

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

N = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

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

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



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:
if __name__ == '__main__':
    from sys import stdin
    # from collections import defaultdict
    # from collections import deque
    # from collections import Counter
    # import numpy as np
    # import math
    # import random
    input = stdin.readline

    k = int(input())

    s = input()[:-1]
    len_s = len(s)
    if len_s <= k:
        print(s)
        exit()
    print(s[:k] + '...')

Submission status: Accepted

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


main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
k  = int(input())
s  = input()
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    K = int(input())
    S = input()
    N = len(S)

    if N <= K:
        print(S)
        return

    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:
def main():
    import sys
    input = sys.stdin.readline
    K = int(input())
    S = input().rstrip()
    if len(S) > K:
        print(S[:K]+ "...")
    else:
        print(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    l = len(s)

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Submission status: Accepted

Solution code:
import itertools
from collections import defaultdict
import collections
import math
import sys
sys.setrecursionlimit(200000)
mod = 1000000007

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

if len(s) > k:
    for i in range(k):
        print(s[i], end="")
    print("...")
else:
    s = ''.join(s)
    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()
n = len(s)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


def input():
    return sys.stdin.readline().rstrip()


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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, numpy, string
import sys
from bisect import bisect_left, bisect_right, insort
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def MS(): return map(str, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
# N = I()
# A = [LI() for _ in range(N)]

k = I()
s = S()
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
def input(): return sys.stdin.readline().strip()

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

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

import sys
sys.setrecursionlimit(300000)


def solve(K: int, S: str):
    if len(S) > K:
        S = S[:K] + '...'
    print(S)
    return

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
k=int(input())
s=input().rstrip()
if len(s)<=k:
    print(s)
else:
    x=s[0:k]+'...'
    print(x)

Submission status: Accepted

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


K = int(readline())
S = readline().strip()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, 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 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

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))


k = readint()
s = readstr()

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
k = int(input())
s = input()

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

Submission status: Accepted

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


if __name__ == "__main__":
    K = int(input())
    S = input()
    print(solve(K, 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:
mod = 1000000007
eps = 10**-9


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

    K = int(input())
    S = input().rstrip('\n')

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

def solve():
    input = sys.stdin.readline
    K = int(input())
    S = input().strip("\n")
    if len(S) <= K: print(S)
    else: print(S[:K] + "...")

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
def main():

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

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

if __name__ == '__main__':
    print(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:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

k = ni()
s = ns()

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

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:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

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

def readInts():
  return list(map(int,input().split()))
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
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    K = Scanner.int()
    S = Scanner.string()
    if len(S) <= K:
        print(S)
    else:
        print(S[0:K], '...', sep='')


def main():
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import numpy as np
import queue
from collections import deque
import heapq

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

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def yn(t):
    if t:
        print("Yes")
    else:
        print("No")


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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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:
import sys
input = sys.stdin.readline
K = int(input())
S = list(input())[: -1]
if len(S) <= K: print("".join(S))
else: print("".join(S[: K]) + "...")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15
dy = (-1,0,1,0)
dx = (0,1,0,-1)

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

Submission status: Accepted

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

def Main(K, S):
    if len(S) <= K:
        return S
    else:
        return S[:K] + '...'
        
res = Main(K, S)
print(res)

Submission status: Accepted

Solution code:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
k=int(input())
S=input()
if len(S)<=k:
  print(S)
else:
  print(S[:k]+"...")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2 * 10**6)


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


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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    K = int(_in[0])  # type:int
    S =     _in[1]   # type:str
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    if len(S)<=K:
        s = S
    else:
        s = S[:K]+'...'
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(s)

Submission status: Accepted

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

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

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8


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

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


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import pprint

sys.setrecursionlimit(10 ** 6)

class Logger:
	def __init__(self, debug):
		self.debug = debug
	def print(self, *args):
		if self.debug:
			pprint.pprint(args)


def main():
	log = Logger(1)
	k = int(sys.stdin.readline())
	s = sys.stdin.readline().rstrip()
	if len(s) <= k:
		print(s)
		exit()
	s = s[:k]
	print(s + "...")
	


main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

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