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