Codeforces Round 364 (Div. 2)
A
Cards
Codeforces
800
原题
←B →
翻译中…

There are $*n*$ cards ($*n*$ is even) in the deck. Each card has a positive integer written on it. $*n* / 2$ people will play new card game. At the beginning of the game each player gets two cards, each card is given to exactly one player.

翻译中…

Find the way to distribute cards such that the sum of values written of the cards will be equal for each player. It is guaranteed that it is always possible.

翻译中…

Input

翻译中…

The first line of the input contains integer $*n*$ ($2 ≤ *n* ≤ 100$) — the number of cards in the deck. It is guaranteed that $*n*$ is even.

翻译中…

The second line contains the sequence of $*n*$ positive integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ ($1 ≤ *a*_{*i*} ≤ 100$), where $*a*_{*i*}$ is equal to the number written on the $*i*$-th card.

翻译中…

Output

翻译中…

Print $*n* / 2$ pairs of integers, the $*i*$-th pair denote the cards that should be given to the $*i*$-th player. Each card should be given to exactly one player. Cards are numbered in the order they appear in the input.

翻译中…

It is guaranteed that solution exists. If there are several correct answers, you are allowed to print any of them.

翻译中…

Note

翻译中…

In the first sample, cards are distributed in such a way that each player has the sum of numbers written on his cards equal to $8$.

翻译中…

In the second sample, all values $*a*_{*i*}$ are equal. Thus, any distribution is acceptable.

翻译中…

样例

Input #1
6
1 5 7 4 4 3
Output #1
1 3
6 2
4 5
InputCopy OutputCopy
Input #2
4
10 10 10 10
Output #2
1 2
3 4
InputCopy OutputCopy
题目信息
题号
701A
时间限制
1 s
内存限制
256 MB
标签
贪心
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。