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