import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int num = sc.nextInt(); ListNode head = null; ListNode tmp = null; for (int i = 0; i < num; i++) { int value = sc.nextInt(); ListNode listNode = new ListNode(value); if (i == 0) { head = listNode; } else { tmp.next = listNode; } tmp = listNode; } int k = sc.nextInt(); int size = 0; ListNode node = null; for (node = head; node != null; node = node.next) { size++; } ListNode target = head; for (int i = 0; i < size - k; i++) { target = target.next; } System.out.println(target.value); } } } class ListNode { int value; ListNode next; public ListNode(int value) { this.value = value; this.next = null; } }