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