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