#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int a[n];
  vector<pair<long long int, long long int>> pos;
  vector<pair<long long int, long long int>> neg;
  vector<pair<long long int, long long int>> zero;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    if (x > 0)
      pos.push_back(make_pair(x, i + 1));
    else if (x < 0)
      neg.push_back(make_pair(x, i + 1));
    else if (x == 0)
      zero.push_back(make_pair(x, i + 1));
  }
  vector<pair<long long int, long long int>> ans;
  sort(neg.begin(), neg.end(), greater<pair<long long int, long long int>>());
  while (neg.size() > 1) {
    long long int o = neg.size();
    pair<long long int, long long int> u = neg[o - 1];
    pair<long long int, long long int> v = neg[o - 2];
    neg.pop_back();
    neg.pop_back();
    pos.push_back({u.first * v.first, v.second});
    ans.push_back({u.second, v.second});
  }
  while (zero.size() > 1) {
    long long int o = zero.size();
    pair<long long int, long long int> u = zero[o - 1];
    pair<long long int, long long int> v = zero[o - 2];
    zero.pop_back();
    zero.pop_back();
    zero.push_back({0, v.second});
    ans.push_back({u.second, v.second});
  }
  while (pos.size() > 1) {
    long long int o = pos.size();
    pair<long long int, long long int> u = pos[o - 1];
    pair<long long int, long long int> v = pos[o - 2];
    pos.pop_back();
    pos.pop_back();
    pos.push_back({u.first * v.first, v.second});
    ans.push_back({u.second, v.second});
  }
  if (neg.size() == 1 && zero.size() == 1) {
    for (long long int i = 0; i < ans.size(); i++)
      cout << 1 << " " << ans[i].first << " " << ans[i].second << endl;
    cout << 1 << " " << neg[0].second << " " << zero[0].second << endl;
    if (pos.size() != 0) cout << 2 << " " << zero[0].second << endl;
  } else if (zero.size() == 1) {
    for (long long int i = 0; i < ans.size(); i++)
      cout << 1 << " " << ans[i].first << " " << ans[i].second << endl;
    if (pos.size() != 0) cout << 2 << " " << zero[0].second << endl;
  } else if (neg.size() == 1) {
    for (long long int i = 0; i < ans.size(); i++)
      cout << 1 << " " << ans[i].first << " " << ans[i].second << endl;
    if (pos.size() != 0) cout << 2 << " " << neg[0].second << endl;
  } else {
    for (long long int i = 0; i < ans.size(); i++)
      cout << 1 << " " << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
