a = [str(s) for s in input().split()]
b=int(input())
#print(a),print(b)
if b>len(a):
    print(a[-1])
else:
    print(a[(b-1)])