#include <iostream>
#include <algorithm>
using namespace std;

const int INF=0x3f3f3f3f;
int a[55];

int main(){
	int n,idx1,idx2;
	int MAX=-1,MIN=INF;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(a[i]<MIN) {MIN=a[i];idx1=i;}
		if(a[i]>MAX) {MAX=a[i];idx2=i;}
	}
	if(abs(MAX)>=abs(MIN)){
		cout<<2*n-1<<endl;
		for(int i=1;i<=n;i++){
			cout<<idx2<<" "<<i<<endl;
		}
		for(int i=1;i<n;i++){
			cout<<i<<" "<<i+1<<endl;
		}
	}
	else{
		cout<<2*n-1<<endl;
		for(int i=1;i<=n;i++){
			cout<<idx1<<" "<<i<<endl;
		}
		for(int i=n;i>1;i--){
			cout<<i<<" "<<i-1<<endl;
		}
	}
	return 0;
}
