CSES - Chess Tournament
  • Time limit: 1.00 s
  • Memory limit: 512 MB

There will be a chess tournament of nn players. Each player has announced the number of games they want to play.

Each pair of players can play at most one game. Your task is to determine which games will be played so that everybody will be happy.

Input

The first input line has an integer nn: the number of players. The players are numbered 1,2,,n1,2,\dots,n.

The next line has nn integers x1,x2,,xnx_1,x_2,\dots,x_n: for each player, the number of games they want to play.

Output

First print an integer kk: the number of games. Then, print kk lines describing the games. You can print any valid solution.

If there are no solutions, print "IMPOSSIBLE".

Constraints

  • 1n1051 \le n \le 10^5
  • i=1nxi2105\sum_{i=1}^{n} x_i \le 2 \cdot 10^5

Example

Input:

5
1 3 2 0 2

Output:

4
1 2
2 3
2 5
3 5