using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace AtCoder.D
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var N = ReadLong();
            var a = ReadLongs();

            var max = a.Max();
            var min = a.Min();

            var l = new List<AddInfo>();
            // すべて非負の場合
            if (max >= 0 && min >= 0)
            {
                l = GetAllPlus(a).ToList();
            }
            // すべて非正の場合
            else if (max <= 0 && min <= 0)
            {
                l = GetAllMinus(a).ToList();
            }
            // 正負混合で正の絶対値が大きい場合
            else if (Math.Abs(max) >= Math.Abs(min))
            {
                l = ChangeAllPlus(a).ToList();
                l.AddRange(GetAllPlus(a).ToList());
            }
            else
            {
                l = ChangeAllMinus(a).ToList();
                l.AddRange(GetAllMinus(a).ToList());
            }

            var sb = new StringBuilder();
            sb.AppendLine(l.Count.ToString());
            foreach (var item in l)
            {
                // 1-indexedに変換
                sb.AppendLine($"{item.From + 1} {item.To + 1}");
            }

            // デバッグ用
            if (true)
            {
                for (int i = 0; i < a.Count - 1; i++)
                {
                    if (a[i] > a[i + 1])
                    {
                        throw new Exception("不正解");
                    }
                }
            }

            return sb.ToString().Trim();
        }

        private static IEnumerable<AddInfo> ChangeAllMinus(List<long> a)
        {
            // 負の絶対値が最も大きいものを取ってきて加える
            var min = long.MaxValue;
            var minIndex = 0;
            for (int j = 0; j < a.Count; j++)
            {
                if (min > a[j])
                {
                    minIndex = j;
                    min = a[j];
                }
            }

            for (int i = 0; i < a.Count; i++)
            {
                if (a[i] <= 0) continue;

                yield return new AddInfo(minIndex, i);
                a[i] += a[minIndex];
            }
        }

        private static IEnumerable<AddInfo> ChangeAllPlus(List<long> a)
        {
            // 正の絶対値が最も大きいものを取ってきて加える
            var max = long.MinValue;
            var maxIndex = 0;
            for (int j = 0; j < a.Count; j++)
            {
                if (max < a[j])
                {
                    maxIndex = j;
                    max = a[j];
                }
            }

            for (int i = 0; i < a.Count; i++)
            {
                if (a[i] >= 0) continue;

                yield return new AddInfo(maxIndex, i);
                a[i] += a[maxIndex];
            }
        }

        private static IEnumerable<AddInfo> GetAllPlus(List<long> a)
        {
            for (int i = 0; i < a.Count - 1; i++)
            {
                if (a[i] <= a[i + 1]) continue;

                yield return new AddInfo(i, i + 1);
                a[i + 1] += a[i];
            }
        }
        private static IEnumerable<AddInfo> GetAllMinus(List<long> a)
        {
            for (int i = a.Count - 1; i > 0; i--)
            {
                if (a[i - 1] <= a[i]) continue;

                yield return new AddInfo(i, i - 1);
                a[i - 1] += a[i];
            }
        }

        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
    class AddInfo
    {
        public int From { get; set; }
        public int To { get; set; }

        public AddInfo(int from, int to)
        {
            From = from;
            To = to;
        }
    }
}


Measured memory_bytes: 28460