while True:
    try:
        string = input()
        number = int(input())
        print(string[:number])
    except:
        break