import sys
s = sys.stdin.readline().strip()
k = int(input())
print(s[:k])