#直接处理输入的字符串,做切片即可
while True:
    try:
        str = input()
        num = int(input())
        print(str[:num])
    except:
        break