inp = input().split(' ') n = int(input()) l = len(inp) s = "" if(n>0 and n=l): s = inp[l-1] #print (inp) print(s)