import sys arr_text = list(map(str, sys.stdin.readline().split())) n, arr_text_len = int(input()), len(arr_text) print(arr_text[n - 1]) if (n - 1) <= arr_text_len else print(arr_text[arr_text_len - 1])