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:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
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:
k=int(input())
s=input()
t=len(s)
if t<=k:
    print(s)
else:
    print(s[:k]+"...")

Submission status: Accepted

Solution code:
k, s = int(input()), 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:
#B
k = int(input())
s = input()

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

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

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

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def rangeI(it, l, r):
    for i, e in enumerate(it):
        if l <= i < r:
            yield e
        elif l >= r:
            break

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

INF = 999999999999999999999999
MOD = 10**9+7

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

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

Submission status: Accepted

Solution code:
# ABC168b


def main():
    import sys
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit

setrecursionlimit(10 ** 9)
INF = 1 << 60


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


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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    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(x) for x in input().split()]
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:
    s = S[:K] + '...'
    print(s)

Submission status: Accepted

Solution code:
#[int(i) for i in input().split()]
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], "...", 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()
if(len(s) <= k):
  print(s)
else:
  print(s[:k] + '...')

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

k = INT()
s = STR()
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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    K=I()
    S=ST()
    if(len(S)<=K):
        print(S)
    else:
        print(S[:K]+"...")
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
from collections import deque, Counter, defaultdict
import heapq

INF = int(1e10)
MOD = int(1e9 + 7)

def input():
    return stdin.readline()[:-1]

def main():
    from builtins import int, map
    K = int(input())
    S = input()
    if len(S) <= K:
        print(S)
    else:
        print("{}{}".format(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()
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)
else:
  print(S[:N] + "...")

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], end="")
    print("...")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


K = int(sys.stdin.buffer.readline())
S = sys.stdin.buffer.readline().decode().rstrip()

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

Submission status: Accepted

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

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

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(500005)
stdin = sys.stdin

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

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

main()

Submission status: Accepted

Solution code:
#!python3

iim = lambda: map(int, input().rstrip().split())

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

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

    print(S)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    k = I()
    s = input()
    if k < len(s):
        print(s[:k]+"...")
    else:
        print(s)
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

print(main())
#print('Yes' if main() else 'No')
#print('YES' if main() else 'NO')

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
string=input()
number=int(input())
characters=len(string)
empty=""
if characters<=number:
    print(string)
else:
   i=0
   while i<=number-1:
       empty+=string[i]
       i=i+1
   print(f"{empty}...")

Submission status: Runtime Error

Solution code:
string=input()
number=int(input())
characters=len(string)
empty=""
if characters<=number:
    print(string)
else:
    i=0
    while i<number:
        empty+=string[i]
        i=i+1
    print(f"{empty}...")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
S1 = list(S)
S2 = len(S1)

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

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
S1 = list(S)
S2 = len(S)

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

Submission status: Runtime Error

Solution code:
S = input()
K = int(input())
S1 = list(S)
S2 = len(S)

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

Submission status: Runtime Error

Solution code:
S = str(input())
K = int(input())
S1 = list(S)
S2 = len(S)

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

Submission status: Runtime Error

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

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

print(S)

Submission status: Runtime Error

Solution code:

# 高橋君の夏休みはN日間です。夏休みの宿題がM個出されており,i番目の宿題をやるにはAi日間かかります。
# 複数の宿題を同じ日にやることはできず、また、宿題をやる日には遊ぶことができません。
# 夏休み中に全ての宿題を終わらせるとき、最大何日間遊ぶことができますか？
# ただし、夏休み中に全ての宿題を終わらせることができないときは、かわりに -1 を出力してください。


N, M = map(int, input().split())
study_days = map(int, input().split())

# リストにM個の数字を、入力したい
# study_days_list = []
# study_days_list.append(study_days)
# print(study_days_list)

total_study_days = sum(study_days)

answer = (N - total_study_days)

if answer < 0:
    print(-1)
else:
    print(answer)

Submission status: Runtime Error

Solution code:

k=input()
s=input()

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

Submission status: Runtime Error

Solution code:
7
nikoandsolstice

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
K = input()

S = int(input())

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


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

Submission status: Runtime Error

Solution code:
K = input()

S = int(input())

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

#[:●]で文字の数の始点をできる
else:
    print(K[:S] + "...")

Submission status: Runtime Error

Solution code:
S = input()

K = int(input())

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

#[:●]で文字の数の始点をできる
else:
    print(S[:K] + "...")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:

def ac_168b(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[0:K] + "..."

K = input()
S = input()
print(ac_168b(K, S))

Submission status: Runtime Error

Solution code:

def ac_168b(K: int, S: str) -> str:
    if len(S) <= K:
        return S
    else:
        return S[0:K] + "..."
    
K = input():
S = input():
print(ac_168b(K, S))

Submission status: Runtime Error

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

length = len(S)

if length <= K:
  print(S)
  
else:
  S = S[K:]
  print(S.apend("..."))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num = int(input())
word = input()

for i in range(num):
    print(word[i],end="")
    if i >= len(word):
        break

if len(word) > num:
    print("...")

Submission status: Runtime Error

Solution code:
num = int(input())
word = input()

for i in range(num):
    print(word[i],end="")

if len(word) > num:
    print("...")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
k = int(input())
s = inpur()
x = len(s)

if k >= x:
  print(s)

else:
  print(s + "...")

Submission status: Runtime Error

Solution code:
k = int(input())
s = inpur()
x = len(s)

if k >= s:
  print(s)

else:
  print(s + "...")

Submission status: Runtime Error

Solution code:
K=int(input())
s =input()
x = len(s)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = input
if (len(s) <= n):
  print(s)
else:
  for i in range (n):
    print(s[i], end = '')
  print()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if len(s) < k :
  print(s)
else:
  print(substr(s,0,k)+"...")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

len_S=len(S)

if K<=len_S:
  print(S)
  
else:
  print(S[K:], "...")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
K = int(input())
S = input()
sentence=""
if len(S) < K:
  print(S)
  exit(0)
if K < len(S):
  for i in range(K):
  sentence = sentence +　S[i]
print(sentence)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

s_li = []
for i in s:
    s_li.append(i)

if len(s_li) > k:
    s_str = s_li[:k]
    print(''.join(s_str) + "...")
else:
    print(''.join(s_str))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
# import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# from fractions import gcd
# input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,m = inpm()
way = [[] for _ in range(n+1)]
for i in range(m):
    a,b = inpm()
    way[a].append(b)
    way[b].append(a)

ans = [0 for i in range(n+1)]
q = queue.Queue()
q.put((1,0))
while not q.empty():
    room,sign = q.get()
    if ans[room] != 0:
        continue
    ans[room] = sign

    for i in way[room]:
        q.put((i,room))

print('Yes')
for i in range(2,n+1):
    print(ans[i])

Submission status: Runtime Error

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# from fractions import gcd
# input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,m = inpm()
way = [[] for _ in range(n+1)]
for i in range(m):
    a,b = inpm()
    way[a].append(b)
    way[b].append(a)

ans = [0 for i in range(n+1)]
q = queue.Queue()
q.put((1,0))
while not q.empty():
    room,sign = q.get()
    if ans[room] != 0:
        continue
    ans[room] = sign

    for i in way[room]:
        q.put((i,room))

print('Yes')
for i in range(2,n+1):
    print(ans[i])

Submission status: Runtime Error

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,m = inpm()
way = [[] for _ in range(n+1)]
for i in range(m):
    a,b = inpm()
    way[a].append(b)
    way[b].append(a)

ans = [0 for i in range(n+1)]
q = queue.Queue()
q.put((1,0))
while not q.empty():
    room,sign = q.get()
    if ans[room] != 0:
        continue
    ans[room] = sign

    for i in way[room]:
        q.put((i,room))

print('Yes')
for i in range(2,n+1):
    print(ans[i])

Submission status: Runtime Error

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

n,m = inpm()
way = [[] for _ in range(n+1)]
for i in range(m):
    a,b = inpm()
    way[a].append(b)
    way[b].append(a)

ans = [0 for i in range(n+1)]
q = queue.Queue()
q.put((1,0))
while not q.empty():
    room,sign = q.get()
    if ans[room] != 0:
        continue
    ans[room] = sign

    for i in way[room]:
        q.put((i,room))

print('Yes')
for i in range(2,n+1):
    print(ans[i])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(K):
    print(S[i],end="")
print("...")

Submission status: Runtime Error

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

if len(s) <= k:
  print(s)
elif len(s) > k:
  print(s[0:k-1]

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a=input() #len input
b=input() #string input
if len(b)>int(a): # if exceed the len given
    print(b[:int(a)],"...",sep = "") #print up to a
else:
    print(c)

Submission status: Runtime Error

Solution code:

def convert(S): 
    str1 = ""  # initialization of string to "" 
    return(str1.join(S))    # using join function join the list s by  
                            # separating words by str1


K = int(input())    # take K from user
readtext= str(input())  # take the input string 

S = list(readtext)   #split the string into charactrers and put them to list
list1=list()  #list 1 

for i in range (0 , K): # for looop to append the charachters to the new list
    a = S[i]
    list1.append(a) # appending the charachters to the list
if len(list1) > K:  # condition when number of charachters is big than K
    b = "..."
    list1.append(b) # append the 3 dots 

print(convert(list1)) # convert the list of characters back to the string format

Submission status: Runtime Error

Solution code:
a=input() #len input
b=input() #string input
if len(b)>int(a): # if exceed the len given
    print(b[:int(a)],"...")
else:
    print(c)

Submission status: Runtime Error

Solution code:
a=input() #len input
b=input() #string input
if len(b)>int(a): # if exceed the len given
    print(b[:int(a)],". . .")
else:
    print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
K=int(input())
S=input()
if lens(s)>k:
    print(S[ :K ] + "...")
else:
    print(s)
S[]
S[5:]

Submission status: Runtime Error

Solution code:

#DECLARE K AND S INPUT
K = int(input())
S = input()

str = S

#if same, no change
#IF bigger plus ...

if lens(S) > K:
       print(str[0:K]+"...")

else:
       print(str)

Submission status: Runtime Error

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

str = S

#if same, no change
if lens(S) == k:
                         print(str)

else:
         print (str[0:K] +"...")

Submission status: Runtime Error

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

str = S

#if same, no change
if lens(s) == K:
                         print(S)

else:
         print (str[0:K] +"...")