while True:
    try:
        str1=input()
        k=int(input())
        print(str1[0:k])
    except:
        break