#CCBCHBAHAI0000175. Số nguyên cô độc (Lonely Integer)

    ID: 1093 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 1 Đăng bởi: Nhãn>FundamentalsProgramming language basicsData StructuresStatic arraysIteration techniquesImplementation techniques

Số nguyên cô độc (Lonely Integer)

Lonely Integer

Source: HackerRank

Version: Phuoc Hung OJ Extended

Problem

You are given an array of nn integers. Exactly one value occurs once, while every other value occurs exactly twice.

Find the value that occurs once.

For Chapter 32, the primary solution uses a frequency array over the small value domain.

Input

  • The first line contains the odd integer nn.
  • The second line contains a1,a2,…,ana_1,a_2,\ldots,a_n.

Output

Print the unique value whose frequency is 11.

Subtasks

Subtask 1 (20 points): 1≤n≤91\le n\le 9, nn is odd, 0≤ai≤200\le a_i\le 20; exactly one value occurs once and every other value occurs exactly twice.

Subtask 2 (30 points): 1≤n≤491\le n\le 49, nn is odd, 0≤ai≤600\le a_i\le 60; exactly one value occurs once and every other value occurs exactly twice.

Subtask 3 (50 points): 1≤n≤991\le n\le 99, nn is odd, 0≤ai≤1000\le a_i\le 100; exactly one value occurs once and every other value occurs exactly twice.

Example

Input

5
0 0 1 2 1

Output

2

Explanation

0 and 1 each occur twice; only 2 occurs once.