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

resolve()

Submission status: Accepted

Solution code:
k = int(input())
S = input()
s = list(S)
p = []
if len(s) <= k:
    print(S)
else:
    for i in range(k):
        p.append(s[i])
    p.append('...')
    print(''.join(p))

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
#sys.exit()
#sorted( ,reverse=True)
#N = int(input())
#S,T = map(int, input().split())
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]

#cnt = 0
#cnt += 1



#print(N)
#print(S,T)
#print(A)
#print('Yes')
#print('No')
#print(cnt)

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import ceil,sqrt,log,gcd,pi
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())

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

Submission status: Accepted

Solution code:
tmp = input().split()
K = int(tmp[0])
N = input().split()


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

Submission status: Accepted

Solution code:
def main():
    k = int(input())
    s = list(input())
    n = len(s)
    if n > k:
        print(*s[:k], "...", sep="")
    else:
        print(*s, sep="")


if __name__ == "__main__":
    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:
def inp():exec('global inppp\ninpmoto,inppp=input().split(),[]\nfor i in inpmoto:\n try:inppp.append(int(i))if float(i).is_integer()else inppp.append(float(i));\n except:\n  try:inppp.append(str(i))\n  except:print("error in inp")');return inppp[0]if len(inppp)==1else list(inppp)
k = inp()
s = inp()
if len(s) <= k:
    print(s)
else:
    print(s[:k]+"...")

Submission status: Accepted

Solution code:
k = int(input())
s = input()		# 文字列の入力  abcdefg...

ans = s

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    k = int(args[0])
    S = args[1]

    return S if len(S) <= k else S[:k]+'...'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# Problem Triple Dots
# input
K = int(input())
S = list(input())
s_len = len(S)

if s_len<=K:
    print("".join(S))
else:
    tmp = S[:K]
    ans = "".join(tmp) + "..."
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

s_len = len(s)
if s_len <= 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:
def main():
    k = int(input())
    s = input()
    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)
else:
    s1=s[0:k]
    s1=s1+"..."
    print(s1)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
K=int(input())
S=input()
sl=[i for i in S]
ans=""
if len(S)<=K:
  print(S)
else:
  for i in range(K):
    ans+=S[i]
  print(ans+"...")

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

s = len(S)

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

Submission status: Accepted

Solution code:
k  = 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:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
K = int(input())
S = input()
#開業されたN個要素を受け付ける
#list = [input() for i in range(N)]
#input_list = [list(map(int, input().split())) for i in range(N)]
ans = ""
if len(S) <= K:
    ans = S
else:
    ans = S[:K] + "..."

print(ans)

Submission status: Accepted

Solution code:
"""
~~ Author : Bhaskar
~~ Dated : 16~05~2020
"""

import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    k = int(sys.stdin.readline())
    s = sys.stdin.readline().replace("\n", "")
    if len(s) <= k:
        print(s)
    else:
        print(s[:k]+"...")


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
hoge=input()
if(n>=len(hoge)):
  print(hoge)
else:
  print(hoge[:n], end="")
  print("...")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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()
T = ''
if len(S) <= K:
    print(S)
else:
    for i in range(K):
        T += S[i]
    print('{}{}'.format(T, '...'))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


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


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
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
    print(solve(K, S))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    test()
    main()

Submission status: Accepted

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

if len(S) <= K :
    print("".join(S))
else :
    print("".join(S[:K]),"...",sep="")

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

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

Submission status: Accepted

Solution code:
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

k = ii()
s = input()

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

Submission status: Accepted

Solution code:
K = int(input())
S = str(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]
s = list(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[:K], "...", sep = "")

Submission status: Accepted

Solution code:
k = int(input())
s = str(input())
s_ = list(s)
if len(s_) <= k:
  ans = s
else:
  ans = ""
  for i in s_[:k]:
    ans += i
  ans += "..."
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

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

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


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

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

Submission status: Accepted

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

if len(s) > max_len:
    print(f"{s[:max_len]}...")
else:
    print(s)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    K = int(input().strip())
    S = input().strip()
    size = len(S)
    if size <= K:
        return S
    else:
        ans = S[:K] + "." * 3
        return ans


if __name__ == "__main__":
    print(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:
length=int(input())
string=input()
if len(string) > length:
  print(string[:length]+'...')
else:
  print(string)

Submission status: Accepted

Solution code:
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())
w = list(input())
if len(w) > k:
    w = w[:k]
    w.append('...')
print(''.join(w))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import os
import sys
from io import BytesIO, IOBase


def solution(s, k):
    n = len(s)
    if n <= k:
        write(s)
    else:
        write(s[:k] + "...")


def main():
    k = r_int()
    s = input()
    solution(s, k)


# fast-io region

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


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def input():
    return sys.stdin.readline().rstrip("\r\n")


def write(*args, end='\n'):
    for x in args[:-1]:
        sys.stdout.write(str(x) + ' ')
    sys.stdout.write(str(args[-1]))
    sys.stdout.write(end)


def r_array():
    return [int(x) for x in input().split()]


def r_int():
    return int(input())


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:
#!/usr/bin/python
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l = len(S)

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

Submission status: Accepted

Solution code:
def main():
    import sys
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    K = int(input())
    S = input().strip()
    if len(S) <= K:
        print(S)
    else:
        print(S[:K]+'...')
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())
def S(): return sys.stdin.readline().rstrip()
K = I()
S = S()
ans = S[:K]
if len(S)>K:
    ans += '...'
print(ans)

Submission status: Accepted

Solution code:
import sys, random, math
from bisect import bisect_left, bisect_right
input = sys.stdin.readline

def main():
    inf = 10 ** 20

#    t = int(input())
#    t, a, b = map(int, input().split())
    t = 1
    
    for _ in range(1, t+1):
    #    print("Case #{}: ".format(_), end = '')
        
        k = int(input())
        s = input().strip()
        if(k < len(s)):
            print(s[:k] + '...')
        else:
            print(s)
        
        
        
main()

Submission status: Accepted

Solution code:
from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

k = ii()
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:

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

    print(S)


if __name__ == '__main__':
    main()

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:
    ans = s[:k] + "..."
    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:
'''
.append(要素) リストに要素を追加
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前

sort()
sorted(reverse=true)

配列の初期化
配列名=[a]*n+[b]*m

Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
from functools import reduce
from operator import mul
from collections import Counter
import itertools
import fractions
import sys

k = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
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[0:k] + "..."
print(ans)

Submission status: Accepted

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

leng = len(s)
amari = leng - k
ans = s[:k]

if amari > 0:
    ans += '...'
    print(ans)
else:
    print(ans)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque, Counter
import math
import pprint
from functools import reduce
# stdin = open("sample.txt")

MOD = 1000000007

def keta(kazu):
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def combination(m,n):
    if n > m:
        return 'すまん'
    return math.factorial(m) // (math.factorial(m-n) * math.factorial(n))

def main():
    a = int(stdin.readline().rstrip())
    s = stdin.readline().rstrip()
    
    if len(s) <= a:
        print(s)
    else:
        print(s[0:a] + '...')
        
main()

Submission status: Accepted

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


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

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

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

Submission status: Accepted

Solution code:
# Code for B - ... (Triple Dots)
# Use input() to fetch data from STDIN
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:
  a=s[:k]+"..."
  print(a)

Submission status: Accepted

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

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

    print(res)



main()

Submission status: Accepted

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

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

    print(S + "...")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

K = intinp()
S = input()

l = len(S)

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