#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
	ll n; cin >> n;
	ll si = 0, na = 1;
	bool f = 0;
	for(ll i = 0; i < n; ++i){
		ll a; cin >> a;
		if((ll)abs(a) > (ll)abs(si)){
			si = a;
			na = i + 1;
			f = a > 0;
		}
	}
	cout << 2 * n << endl;
	cout << na << " " << (f ? 1 : n) << endl;
	cout << na << " " << (f ? 1 : n) << endl;
	for(ll i = 1; i < n; ++i){
		cout << (f ? i : n + 1 - i) << " " << (f ? i + 1 : n - i) << endl;
		cout << (f ? i : n + 1 - i) << " " << (f ? i + 1 : n - i) << endl;
	}
	return 0;
}