while True:
    try:
        str = input()
        n = int(input())
        print(str[:n])
    except:
        break