# 1.提取输入的字符串和长度
str1=input()
num=int(input())

str2=''
count=0
# 2.遍历字符串。当小于要提取的长度,逐个字符提取放在str2
while count<num:
    str2=str2+str1[count]
    count=count+1
print(str2)