a = input().split(' ') n = int(input()) if len(a) < b: print(a[-1]) else: print(a[b - 1])