inp=(list(map(str, input().split()))) inp2 = int(input()) if len(inp) < inp2: print(inp[len(inp)-1]) else: print(inp[inp2-1])