// Example program

#include <bits/stdc++.h>
using namespace std;

typedef pair<int,int> ii;
typedef vector<ii> vii;

int main() {
    int n;
    cin >> n;
    vector<int> arr(n);
    for(int i = 0; i < n; i++) cin >> arr[i];
    int index = 0;
    int number = 0;
    for(int i = 0; i < n; i++) {
        if(abs(arr[i]) > number) {
            index = i;
            number = abs(arr[i]);
        }    
    }
    vii ans;
    
    for(int i = 0; i < n; i++) {
        ans.push_back(ii(index,i));
        arr[i] += arr[index];
    }
    if(arr[index] < 0) {
        for(int i = n-2; i >= 0; i--) {
            ans.push_back(ii(i+1,i));    
        }
    } else { 
        for(int i = 1; i < n; i++) {
            ans.push_back(ii(i-1,i));
        }    
    }
    cout << ans.size() << endl;
    for(int i = 0; i < ans.size(); i++ ){
        cout << ans[i].first+1 << " " << ans[i].second+1 << endl;
    }
}
