words = input().split() print(words) n = int(input()) print(words[min(n, len(words)) - 1])