while True:
    try:
        l,k=input(),int(input())
        print(l[:k])
        
        

    except:
        break