/*===============================================================
*  Filename: A.cpp
*  Author: zhuyutian
*  Date: 2018.04.15
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const int maxn = 100005;

int n;
int a[maxn];
vector<pair<int,int> > ans;

int main()
{
    //freopen("A.in","r",stdin);
    //freopen("A.out","w",stdout);
    cin>>n;
	for(int i = 0; i < n; i++) cin>>a[i];
	int x = 0;
	for(int i = 0; i < n; i++)
		if(abs(a[x]) < abs(a[i]))
			x = i;
	for(int i = 0; i < n; i++){
		if(a[i] == a[x]) continue;
		ans.push_back(make_pair(x + 1,i + 1));
		a[i] += a[x];
	}
	if(a[n - 1] < 0)
		for(int i = n - 1; i; i--){
			ans.push_back(make_pair(i + 1,i));
			a[i - 1] += a[i];
		}
	else for(int i = 1; i < n; i++){
		ans.push_back(make_pair(i,i + 1));
		a[i] += a[i - 1];
	}
	cout<<ans.size()<<endl;
	for(int i = 0; i < ans.size(); i++)
		cout<<ans[i].first<<" "<<ans[i].second<<endl;
	return 0;
}
