#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 11;
long long a[maxn];
struct Node {
  long long ai;
  int idx;
  bool operator<(const Node& rhs) const { return ai > rhs.ai; }
};
priority_queue<Node> pq;
int main(int argc, char const* argv[]) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int low0 = 0, num0 = 0;
  for (int i = 1; i < n + 1; ++i) {
    cin >> a[i];
    pq.push((Node){a[i], i});
    if (a[i] < 0) ++low0;
    if (a[i] == 0) ++num0;
  }
  bool use2 = false;
  while (pq.size() != 1) {
    Node tmp1 = pq.top();
    pq.pop();
    if (tmp1.ai < 0) {
      --low0;
      if (low0 > 0) {
        --low0;
        Node tmp2 = pq.top();
        pq.pop();
        pq.push((Node){1, tmp2.idx});
        cout << "1 ";
        cout << tmp1.idx << " " << tmp2.idx << endl;
        continue;
      } else {
        if (num0 == 0 && !use2) {
          cout << "2 ";
          cout << tmp1.idx << endl;
          use2 = true;
          continue;
        } else {
          Node tmp2 = pq.top();
          pq.pop();
          pq.push((Node){0, tmp2.idx});
          cout << "1 ";
          cout << tmp1.idx << " " << tmp2.idx << endl;
          continue;
        }
      }
    }
    if (tmp1.ai == 0) {
      --num0;
      if (num0 > 0 || use2) {
        Node tmp2 = pq.top();
        pq.pop();
        pq.push((Node){0, tmp2.idx});
        cout << "1 ";
        cout << tmp1.idx << " " << tmp2.idx << endl;
        continue;
      } else {
        cout << "2 ";
        cout << tmp1.idx << endl;
        continue;
      }
    }
    if (tmp1.ai > 0) {
      Node tmp2 = pq.top();
      pq.pop();
      pq.push((Node){1, tmp2.idx});
      cout << "1 ";
      cout << tmp1.idx << " " << tmp2.idx << endl;
    }
  }
  return 0;
}
