str_in = input().split() try: print(str_in[int(input())-1]) except: print(str_in[len(str_in)-1])