with open('input.txt','r') as f: l=list(f.readline().split(' ')) n = int(f.readline()) if len(l)>=n: print(l[n-1]) else: print(l[-1])