while True:
    try:
        a = input() #字符串
        b = int(input()) #截取几个字符
        c = a[:b] #截取
        print(c) #输出
    except:
        break