#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n);
  vector<long long> zidx, nidx, pidx;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0)
      zidx.push_back(i);
    else if (a[i] < 0)
      nidx.push_back(i);
    else if (a[i] > 0)
      pidx.push_back(i);
  }
  vector<pair<long long, pair<long long, long long>>> ans;
  long long lastzero = -1;
  for (long long i = 0; i < zidx.size(); i++) {
    lastzero = zidx[i];
    if (i + 1 < zidx.size()) {
      ans.push_back(make_pair(1, make_pair(zidx[i], zidx[i + 1])));
    }
  }
  long long lastneg = -1, removneg = -1;
  if (nidx.size() > 0) {
    if ((nidx.size()) % 2 == 0) {
      for (long long i = 0; i < nidx.size(); i++) {
        lastneg = nidx[i];
        if (i + 1 < nidx.size())
          ans.push_back(make_pair(1, make_pair(nidx[i], nidx[i + 1])));
      }
    } else {
      long long maxx = INT_MIN, maxxidx = -1, taken = -1;
      for (long long i = 0; i < nidx.size(); i++) {
        if (a[nidx[i]] > maxx) {
          maxx = a[nidx[i]];
          maxxidx = nidx[i];
          taken = i;
        }
      }
      removneg = nidx[taken];
      nidx[taken] = -1;
      sort(nidx.begin(), nidx.end());
      for (long long i = 1; i < nidx.size(); i++) {
        lastneg = nidx[i];
        if (i + 1 < nidx.size())
          ans.push_back(make_pair(1, make_pair(nidx[i], nidx[i + 1])));
      }
    }
  }
  long long lastpos = -1;
  if (pidx.size() > 0) {
    for (long long i = 0; i < pidx.size(); i++) {
      lastpos = pidx[i];
      if (i + 1 < pidx.size())
        ans.push_back(make_pair(1, make_pair(pidx[i], pidx[i + 1])));
    }
  }
  long long f = 0;
  if (pidx.size() <= 0 && nidx.size() <= 1) f = 1;
  if (lastpos == -1 && lastneg != -1)
    lastpos = lastneg;
  else if (lastpos != -1 && lastneg == -1)
    lastpos = lastpos;
  else if (lastpos != -1 && lastneg != -1) {
    ans.push_back(make_pair(1, make_pair(lastpos, lastneg)));
    lastpos = lastneg;
  }
  if (lastzero != -1 && removneg != -1) {
    ans.push_back(make_pair(1, make_pair(lastzero, removneg)));
    if (f == 0) ans.push_back(make_pair(2, make_pair(removneg, -1)));
  } else if (lastzero == -1 && removneg != -1 && f == 0)
    ans.push_back(make_pair(2, make_pair(removneg, -1)));
  else if (lastzero != -1 && removneg == -1 && f == 0)
    ans.push_back(make_pair(2, make_pair(lastzero, -1)));
  for (long long i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " ";
    if (ans[i].first == 1)
      cout << ans[i].second.first + 1 << " " << ans[i].second.second + 1
           << "\n";
    else
      cout << ans[i].second.first + 1 << "\n";
  }
  return 0;
}
