It’s universally acknowledged that there’re innumerable trees in the campus of HUST.
You’ve found N forests under the management of a strange-tempered ranger. He told you that the i-th forest consisted of ai trees, and you can transplant these trees between any two forests i and j in such a strange rule: if and only if ai<=aj, then you could transplant ai trees from the forest j to the forest i. Now you want to know if you could make it that only two forests remain non-empty at last after some operations.
The first line contains a integer N, the number of forests.
The next line are N integers following, indicating the initial number of trees in each forest, a1, a2, a3, ... ,an,.
In the first line you output an integer K, the number of steps in your solution.
Then K lines follow, in each line are two integers i and j, indicating a movement from the forest i to the forest j.