简单的字符串索引
while True: try: str1 = str(input()) num1 = int(input()) str2 = str1[0:num1] print(str2) except: break