(lambda s, x: print(s[x - 1] if x - 1 < len(s) else s[-1]))(input().split(), int(input()))