while True:
try:
a = input()
k = int(input())
print(a[0:k]) #截取前k个字符并输出
except:
break
while True:
try:
a = input()
k = int(input())
print(a[0:k]) #截取前k个字符并输出
except:
break