B - Who is missing? Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 200

問題文

整数 1, 2, \dots, N が書かれたカードが 4 枚ずつ、合計 4N 枚あります。

高橋君は、これらのカードをシャッフルしたのち 1 枚のカードを選んで抜き取り、残りの 4N - 1 枚を束にしてあなたに渡しました。渡された束の i \, (1 \leq i \leq 4N - 1) 枚目のカードには、整数 A_i が書かれています。

高橋君が抜き取ったカードに書かれていた整数を求めてください。

制約

  • 1 \leq N \leq 10^5
  • 1 \leq A_i \leq N \, (1 \leq i \leq 4N - 1)
  • k \, (1 \leq k \leq N) に対し、A_i = k となる i4 個以下である。
  • 入力は全て整数である。

入力

入力は以下の形式で標準入力から与えられる。

N
A_1 A_2 \ldots A_{4N - 1}

出力

答えを出力せよ。


入力例 1

3
1 3 2 3 3 2 2 1 1 1 2

出力例 1

3

高橋君が抜き取ったカードには 3 が書かれています。


入力例 2

1
1 1 1

出力例 2

1

入力例 3

4
3 2 1 1 2 4 4 4 4 3 1 3 2 1 3

出力例 3

2

Score : 200 points

Problem Statement

We have 4 cards with an integer 1 written on it, 4 cards with 2, \ldots, 4 cards with N, for a total of 4N cards.

Takahashi shuffled these cards, removed one of them, and gave you a pile of the remaining 4N-1 cards. The i-th card (1 \leq i \leq 4N - 1) of the pile has an integer A_i written on it.

Find the integer written on the card removed by Takahashi.

Constraints

  • 1 \leq N \leq 10^5
  • 1 \leq A_i \leq N \, (1 \leq i \leq 4N - 1)
  • For each k \, (1 \leq k \leq N), there are at most 4 indices i such that A_i = k.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 \ldots A_{4N - 1}

Output

Print the answer.


Sample Input 1

3
1 3 2 3 3 2 2 1 1 1 2

Sample Output 1

3

Takahashi removed a card with 3 written on it.


Sample Input 2

1
1 1 1

Sample Output 2

1

Sample Input 3

4
3 2 1 1 2 4 4 4 4 3 1 3 2 1 3

Sample Output 3

2