시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB91775790.476%

문제

The University of INC (UOI) is participating in an ICPC Provincial Contest, a qualifier contest for the ICPC Regional Contest. UOI has $3N$ students (numbered from $1$ to $3N$) who are eager to participate in the contest. There will be $N$ teams, each consisting of exactly $3$ students. Each student can only be assigned to only one team.

As the coach of UOI, you know that student $i$ has a skill rating of $A_i$. You define the strength of a team as the median of the skill ratings of its members.

In order to increase the chance for all UOI teams to qualify for the ICPC Regional Contest, you want to arrange the teams so that the strength of the weakest team is maximized. Determine the maximum strength of the weakest team.

입력

The first line consists of an integer $N$ ($1 ≤ N ≤ 100\, 000$).

The second line consists of $3N$ integers $A_i$ ($0 ≤ A_i ≤ 4000$).

출력

Output a single integer representing the maximum strength of the weakest team.

예제 입력 1

2
1500 1700 1800 2300 2500 2600

예제 출력 1

1800

Team $1$ consists of students $1$, $3$, and $5$, while team $2$ consists of students $2$, $4$, and $6$. The strength of team $1$ and $2$ are $1800$ and $2300$, respectively. Other arrangements exist, but none allow the weakest team to have a strength higher than $1800$.

예제 입력 2

1
2800 2100 3000

예제 출력 2

2800

There is only one team with the strength of $2800$.

예제 입력 3

3
4000 0 4000 0 4000 0 4000 0 4000

예제 출력 3

0