#44940: python極簡一行解


x__1 (^_^ 809-34)


print(input().split()[-int(input())])