#include<bits/stdc++.h>
using namespace std;
bool used[100002];
int main(){
	int n;
	cin>>n;
	int a[n],m1=1e9,m2=-1e9,i1,i2;
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(m1>a[i]){
		  m1=min(m1,a[i]);
		  i2=i;
		}
		if(m2<a[i]){
		  m2=max(m2,a[i]);
		  i1=i;
		}
	}
	if(abs(m1)<abs(m2)){
		cout<<n*2<<endl;
		cout<<i1+1<<' '<<1<<endl;
		cout<<i1+1<<' '<<1<<endl;
		for(int i=0;i<n-1;i++){
			cout<<i+1<<' '<<i+2<<endl;
		    cout<<i+1<<' '<<i+2<<endl;
		}
	}
	else{
		cout<<n*2<<endl;
		cout<<i2+1<<' '<<n<<endl;
		cout<<i2+1<<' '<<n<<endl;
		for(int i=n-1;i>=1;i--){
			cout<<i+1<<' '<<i<<endl;
		    cout<<i+1<<' '<<i<<endl;
		}
	}
}