program non_decreasing
  implicit none
  integer :: n, a(50), mn, mx, i, in, ix, k, b(50,2)
  a = 0
  b = 0
  read(*,*) n
  read(*,*) a(1:n)
  mn = 1000000
  in = -1
  mx = -1000000
  ix = -1
  do i = 1, n
    if (mn.ge.a(i)) then
      mn = a(i)
      in = i
    end if
    if (mx.le.a(i)) then
      mx = a(i)
      ix = i
    end if
  end do
  k = 0
  if (mn*mx.lt.0) then
    if (mx.gt.abs(mn)) then
      mn = mn + mx
      do i = 1, n
        if (a(i).lt.0) then
          k = k + 1
          b(k,1) = ix
          b(k,2) = i
          a(i) = a(i) + mx
        end if
      end do
    else
      mx = mx + mn
      do i = 1, n
        if (a(i).gt.0) then
          k = k + 1
          b(k,1) = in
          b(k,2) = i
          a(i) = a(i) + mn
        end if
      end do
    end if
  end if
  write(*,'(i0)') k+n-1
  if (k.gt.0) then
    do i = 1, k
      write(*,'(i0,x,i0)') b(i,1), b(i,2)
    end do
  end if
  if (mn.ge.0) then
    do i = 2, n
      write(*,'(i0,x,i0)') i-1, i
    end do
    stop
  end if
  if (mx.le.0) then
    do i = n-1, 1, -1
      write(*,'(i0,x,i0)') i+1, i
    end do
    stop
  end if
  stop
end program non_decreasing