while True: try: s = input() # 如果后边加了.split(),则会错误 n = len(s) k = int(input()) print(s[0:k]) except: break