#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;
typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;

    set <pair <int, int> > bad, ok, zero;
    for(int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;

        if (x > 0)
            ok.insert(make_pair(x, i) );
        if (x < 0)
            bad.insert(make_pair(-x, i) );
        if (!x)
            zero.insert(make_pair(0, i));
    }

    int _time = 0;
    pair <int, int> last;
    vector <pair <int, int> > del;
    for(auto i : zero)
    {
        if (_time)
        {
            cout << "1 " << last.second << " " << i.second << "\n";
            del.push_back(last);
        }
        last = i;
        _time++;
    }

    for(auto i : del)
        zero.erase(i);

    if (bad.size() % 2 == 0)
    {
        if (zero.size())
        {
            auto j = zero.begin();
            cout << "2 " << j -> second << "\n";
            zero.erase(j);
        }

        vector <int> way;
        for(auto i : bad)
            way.push_back(i.second);
        for(auto i : ok)
            way.push_back(i.second);
        int last = 0;
        for(int i = 0; i < way.size(); i++)
        {
            if (i)
                cout << "1 " << last << " " << way[i] << "\n";
            last = way[i];
        }
    }
    else
    {
        if (zero.size())
        {
            auto j = bad.begin();
            auto j1 = zero.begin();

            cout << "1 " << j -> second << " " << j1 -> second << "\n";
            bad.erase(j);
            if (ok.size() or bad.size())
            {
                cout << "2 " << j1 -> second << "\n";
                zero.erase(j1);
            }
        }
        else
        {
            auto i = bad.begin();
            cout << "2 " << i -> second << "\n";
            bad.erase(i);
        }
        vector <int> way;
        for(auto i : bad)
            way.push_back(i.second);
        for(auto i : ok)
            way.push_back(i.second);
        int last = 0;
        for(int i = 0; i < way.size(); i++)
        {
            if (i)
                cout << "1 " << last << " " << way[i] << "\n";
            last = way[i];
        }
    }

    return 0;
}
/*
*/


#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;
typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;

    vector <int> ok, bad, zero;
    for(int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;

        if (!x)
            zero.push_back(i);
        else
            if (x > 0)
                ok.push_back(i);
            else
                bad.push_back(i);
    }

    vector <int> used(n + 1);

    int last = 0;
    for(int i = 0; i < zero.size(); i++)
    {
        if (i)
            cout << "1 " << last << " " << zero[i] << "\n";

        if (i)
            used[last] = 1;
        last = zero[i];
    }

    last = 0;
    for(int i = 0; i < ok.size(); i++)
    {
        if (i)
            cout << "1 " << last << " " << ok[i] << "\n";
        if (i)
            used[last] = 1;
        last = ok[i];
    }

    last = 0;
    for(int i = 0; i < bad.size(); i++)
    {
        if (i)
            cout << "1 " << last << " " << bad[i] << "\n";

        if (i)
            used[last] = 1;
        last = bad[i];
    }

    if (bad.size() % 2 == 0)
    {
        if (zero.size())
        {
            cout << "2 " << zero.back() << "\n";
            used[zero.back()] = 1;
        }

        int kek = 0;
        for(int i = 1; i <= n; i++)
            if (!used[i])
                kek = i;

        for(int i = 1; i <= n; i++)
            if (!used[i] and kek != i)
                cout << "1 " << i << " " << kek << "\n";
    }
    else
    {
        if (zero.size())
        {
            cout << "1 " << zero.back() << " " << bad.back() << "\n";
            used[zero.back()] = 1;
            used[bad.back()] = 1;
            cout << "2 " << bad.back() << "\n";
        }
        else
        {
            cout << "2 " << bad.back() << "\n";
            used[bad.back()] = 1;
        }

        int kek = 0;
        for(int i = 1; i <= n; i++)
            if (!used[i])
                kek = i;
        for(int i = 1; i <= n; i++)
            if (!used[i] and i != kek)
                cout << "2 " << i << " " << kek << "\n";
    }

    return 0;
}
/*
*/


#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;
typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;

    int x;
    set <int> ok, bad, zero;
    for(int i = 0; i < n; i++)
    {
        cin >> x;
        if (x > 0)
            ok.insert(i);
        if (x < 0)
            bad.insert(i);
        if (!x)
            zero.insert(i);
    }

    if (bad.size() % 2 == 0)
    {
        // not del bad

        if (zero.size() > 1)
        {
            // res = 0

            for(int i = 0; i < n - 1; i++)
                cout << "1 " << i + 1 << " " << n << "\n";
            return 0;
        }
        else
        {
            int pos = *(zero.begin()) + 1;
            cout << "2 " << pos << "\n";
            int kek = n;
            if (kek == pos)
                kek--;

            for(int i = 0; i < n; i++)
                if (i + 1 != pos and i + 1 != kek)
                    cout << "1 " << i + 1 << " " << kek << "\n";
            return 0;
        }

    }
    else
    {
        if (zero.size())
        {
            // res = 0
            for(int i = 0; i < n - 1; i++)
                cout << "1 " << i + 1 << " " << n << "\n";
            return 0;
        }
        else
        {
            int pos = *(bad.begin()) + 1;
            cout << "2 " << pos << "\n";

            int kek = n;
            if (kek == pos)
                kek--;

            for(int i = 0; i < n; i++)
                if (i + 1 != pos and i + 1 != kek)
                    cout << "1 " << i + 1 << " " << kek << "\n";
            return 0;
        }
    }

    return 0;
}
/*
*/


#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;
typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;

    vector <int> ok, bad, zero;
    for(int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;

        if (!x)
            zero.push_back(i);
        else
            if (x > 0)
                ok.push_back(i);
            else
                bad.push_back(i);
    }

    vector <int> used(n + 1);

    int last = 0;
    for(int i = 0; i < zero.size(); i++)
    {
        if (i)
            cout << "1 " << last << " " << zero[i] << "\n";

        if (i)
            used[last] = 1;
        last = zero[i];
    }

    last = 0;
    for(int i = 0; i < ok.size(); i++)
    {
        if (i)
            cout << "1 " << last << " " << ok[i] << "\n";
        if (i)
            used[last] = 1;
        last = ok[i];
    }

    last = 0;
    for(int i = 0; i < bad.size() - (zero.size() == 0); i++)
    {
        if (i)
            cout << "1 " << last << " " << bad[i] << "\n";

        if (i)
            used[last] = 1;
        last = bad[i];
    }

    if (bad.size() % 2 == 0)
    {
        if (zero.size())
        {
            if (bad.size() or ok.size())
            {
                cout << "2 " << zero.back() << "\n";
                used[zero.back()] = 1;
            }
        }

        int kek = 0;
        for(int i = 1; i <= n; i++)
            if (!used[i])
                kek = i;

        for(int i = 1; i <= n; i++)
            if (!used[i] and kek != i)
                cout << "1 " << i << " " << kek << "\n";
    }
    else
    {
        if (zero.size())
        {
            cout << "1 " << zero.back() << " " << bad.back() << "\n";
            used[zero.back()] = 1;

            if (ok.size())
            {
                used[bad.back()] = 1;
                cout << "2 " << bad.back() << "\n";
            }
        }
        else
        {
            cout << "2 " << bad.back() << "\n";
            used[bad.back()] = 1;
        }

        int kek = 0;
        for(int i = 1; i <= n; i++)
            if (!used[i])
                kek = i;
        for(int i = 1; i <= n; i++)
            if (!used[i] and i != kek)
                cout << "2 " << i << " " << kek << "\n";
    }

    return 0;
}
/*
*/


#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;
typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

int main()
{
    //cin.tie(0);
    //ios::sync_with_stdio(0);

    int n;
    cin >> n;

    set <pair <int, int> > bad, ok, zero;
    for(int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;

        if (x > 0)
            ok.insert(make_pair(x, i) );
        if (x < 0)
            bad.insert(make_pair(-x, i) );
        if (!x)
            zero.insert(make_pair(0, i));
    }

    int _time = 0;
    pair <int, int> last;
    vector <pair <int, int> > del;
    for(auto i : zero)
    {
        if (_time)
        {
            cout << "1 " << last.second << " " << i.second << "\n";
            del.push_back(last);
        }
        last = i;
        _time++;
    }

    for(auto i : del)
        zero.erase(i);

    if (bad.size() % 2 == 0)
    {
        if (zero.size() and (bad.size() or ok.size() ) )
        {
            auto j = zero.begin();
            cout << "2 " << j -> second << "\n";
            zero.erase(j);
        }

        vector <int> way;
        for(auto i : bad)
            way.push_back(i.second);
        for(auto i : ok)
            way.push_back(i.second);

        int last = 0;
        for(int i = 0; i < way.size(); i++)
        {
            if (i)
                cout << "1 " << last << " " << way[i] << "\n";
            last = way[i];
        }
    }
    else
    {
        if (zero.size())
        {
            auto j = bad.begin();
            auto j1 = zero.begin();

            cout << "1 " << j -> second << " " << j1 -> second << "\n";
            bad.erase(j);
            if (ok.size() or bad.size())
            {
                cout << "2 " << j1 -> second << "\n";
                zero.erase(j1);
            }
        }
        else
        {
            auto i = bad.begin();
            cout << "2 " << i -> second << "\n";
            bad.erase(i);
        }
        vector <int> way;
        for(auto i : bad)
            way.push_back(i.second);
        for(auto i : ok)
            way.push_back(i.second);
        int last = 0;
        for(int i = 0; i < way.size(); i++)
        {
            if (i)
                cout << "1 " << last << " " << way[i] << "\n";
            last = way[i];
        }
    }

    return 0;
}
/*
*/


#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;
typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;

    set <pair <int, int> > bad, ok, zero;
    for(int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;

        if (x > 0)
            ok.insert(make_pair(x, i) );
        if (x < 0)
            bad.insert(make_pair(-x, i) );
        if (!x)
            zero.insert(make_pair(0, i));
    }

    int _time = 0;
    pair <int, int> last;
    vector <pair <int, int> > del;
    for(auto i : zero)
    {
        if (_time)
        {
            cout << "1 " << last.second << " " << i.second << "\n";
            del.push_back(last);
        }
        last = i;
        _time++;
    }

    for(auto i : del)
        zero.erase(i);

    if (bad.size() % 2 == 0)
    {
        if (zero.size())
        {
            auto j = zero.begin();
            cout << "2 " << j -> second << "\n";
            zero.erase(j);
        }

        vector <int> way;
        for(auto i : bad)
            way.push_back(i.second);
        for(auto i : ok)
            way.push_back(i.second);
        int last = 0;
        for(int i = 0; i < way.size(); i++)
        {
            if (i)
                cout << "1 " << last << " " << way[i] << "\n";
            last = way[i];
        }
    }
    else
    {
        if (zero.size())
        {
            auto j = bad.begin();
            auto j1 = zero.begin();

            cout << "1 " << j -> second << " " << j1 -> second << "\n";
            cout << "2 " << j1 -> second << "\n";
            bad.erase(j);
            zero.erase(j1);
        }
        else
        {
            auto i = bad.begin();
            cout << "2 " << i -> second << "\n";
            bad.erase(i);
        }
        vector <int> way;
        for(auto i : bad)
            way.push_back(i.second);
        for(auto i : ok)
            way.push_back(i.second);
        int last = 0;
        for(int i = 0; i < way.size(); i++)
        {
            if (i)
                cout << "1 " << last << " " << way[i] << "\n";
            last = way[i];
        }
    }

    return 0;
}
/*
*/


#include <bits/stdc++.h>

#define y1 theboatman
#define make_struct(args...) {args}

using namespace std;
typedef long long ll;

const long long INF = 1e18 + 10;
const int inf = 1e9 + 10;
const int N = 1e6 + 10;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin >> n;

    vector <int> ok, bad, zero;
    for(int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;

        if (!x)
            zero.push_back(i);
        else
            if (x > 0)
                ok.push_back(i);
            else
                bad.push_back(i);
    }

    vector <int> used(n + 1);

    int last = 0;
    for(int i = 0; i < zero.size(); i++)
    {
        if (i)
            cout << "1 " << last << " " << zero[i] << "\n";

        if (i)
            used[last] = 1;
        last = zero[i];
    }

    last = 0;
    for(int i = 0; i < ok.size(); i++)
    {
        if (i)
            cout << "1 " << last << " " << ok[i] << "\n";
        if (i)
            used[last] = 1;
        last = ok[i];
    }

    last = 0;
    for(int i = 0; i < bad.size(); i++)
    {
        if (i)
            cout << "1 " << last << " " << bad[i] << "\n";

        if (i)
            used[last] = 1;
        last = bad[i];
    }

    if (bad.size() % 2 == 0)
    {
        if (zero.size())
        {
            if (ok.size() or bad.size())
            {
                cout << "2 " << zero.back() << "\n";
                used[zero.back()] = 1;

            }
        }

        int kek = 0;
        for(int i = 1; i <= n; i++)
            if (!used[i])
                kek = i;

        for(int i = 1; i <= n; i++)
            if (!used[i] and kek != i)
                cout << "1 " << i << " " << kek << "\n";
    }
    else
    {
        if (zero.size())
        {
            cout << "1 " << zero.back() << " " << bad.back() << "\n";
            used[zero.back()] = 1;

            if (ok.size())
            {
                used[bad.back()] = 1;
                cout << "2 " << bad.back() << "\n";
            }
        }
        else
        {
            cout << "2 " << bad.back() << "\n";
            used[bad.back()] = 1;
        }

        int kek = 0;
        for(int i = 1; i <= n; i++)
            if (!used[i])
                kek = i;
        for(int i = 1; i <= n; i++)
            if (!used[i] and i != kek)
                cout << "2 " << i << " " << kek << "\n";
    }

    return 0;
}
/*
*/


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n|| ( (int)zr.size()+(int)ng.size()==n&&((int)ng.size()%2==1 ) ) ){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
            ng.erase(it);
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0)
            cout<<"2 "<<((*zr.begin()).S)<<endl;

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
        }
    //}

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if(zr.size()==n){
        fl=1;
    }
    int rem=0;
    if(ng.size()&1){
        //cout<<"here\n";
        auto it=*ng.begin();
        cout<<"2 "<<it.S<<endl;
        rem=it.S;
        ng.erase(it);
        int l=1,nxt=2;
        if(rem==1){
            l=2;
            nxt=3;
        }
        if(nxt==2&&rem==2)nxt=3;

        while(nxt<=n){
            cout<<"1 "<<l<<" "<<nxt<<endl;
            l=nxt;
            nxt++;
            if(nxt==rem)nxt++;
        }
    }
    else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0)
            cout<<"2 "<<((*zr.begin()).S)<<endl;

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
        }
    }

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
            ng.erase(it);
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0)
            cout<<"2 "<<((*zr.begin()).S)<<endl;

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
        }
    //}

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n/*|| ( (int)zr.size()+(int)ng.size()==n&&((int)ng.size()%2==1 ) )*/ ){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
            ng.erase(it);
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0){
            cout<<"2 "<<((*zr.begin()).S)<<endl;
            zr.erase(zr.begin());
        }

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(zr.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(ng.begin());
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
            ng.erase(ng.begin());
            //ng.erase(ps.begin());
        }

    //}

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n/*|| ( (int)zr.size()+(int)ng.size()==n&&((int)ng.size()%2==1 ) )*/ ){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
            ng.erase(it);
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0&&((int)ng.size()>0||(int)ps.size()>0)){
            cout<<"2 "<<((*zr.begin()).S)<<endl;
            zr.erase(zr.begin());
        }

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(zr.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(ng.begin());
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
            ng.erase(ng.begin());
            //ng.erase(ps.begin());
        }

    //}

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n|| ( (int)zr.size()+(int)ng.size()==n&&((int)ng.size()%2==1 ) ) ){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
            ng.erase(it);
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0){
            cout<<"2 "<<((*zr.begin()).S)<<endl;
            zr.erase(zr.begin());
        }

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(zr.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(ng.begin());
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
            ng.erase(ng.begin());
            //ng.erase(ps.begin());
        }

    //}

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n|| ( (int)zr.size()+(int)ng.size()==n&&((int)ng.size()%2==1 ) ) ){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
            ng.erase(it);
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0)
            cout<<"2 "<<((*zr.begin()).S)<<endl;

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(zr.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(ng.begin());
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
            ng.erase(ng.begin());
            //ng.erase(ps.begin());
        }

    //}

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n|| ( (int)zr.size()+(int)ng.size()==n&&((int)ng.size()%2==1 ) ) ){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
            ng.erase(it);
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0)
            cout<<"2 "<<((*zr.begin()).S)<<endl;

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
            ng.erase(ng.begin());
        }

        if(zr.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*zr.begin()).S)<<endl;
        }

    //}

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n|| ( (int)zr.size()+(int)ng.size()==n&&((int)ng.size()%2==1 ) ) ){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
            ng.erase(it);
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0)
            cout<<"2 "<<((*zr.begin()).S)<<endl;

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
        }

        if(zr.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*zr.begin()).S)<<endl;
        }

    //}

    return 0;
}


#include        <bits/stdc++.h>
#define ll      long long int
#define pb      push_back
#define mp      make_pair
#define F       first
#define S       second
#define MOD     1000000007
#define pii     pair<int,int>
#define vi      vector<int>
#define fio     ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define N       200010
#define M       600010
using namespace std;

set<pii>ng,ps,zr;

int main() {
    fio;
    int n,x;
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x;
        if(x<0){
            ng.insert({abs(x),i});
        }
        else if(x>0){
            ps.insert({x,i});
        }
        else{
            zr.insert({0,i});
        }
    }

    int fl=0;
    if((int)zr.size()==n){
        fl=1;
    }
    int rem=0;
    if((int)ng.size()&1){
        //cout<<"here\n";
        auto it=ng.begin();
        rem=it->S;
        if(zr.size()>0){
            cout<<"1 "<<rem<<" "<<((*zr.begin()).S)<<endl;
            ng.erase(it);

        }
        else{
            cout<<"2 "<<rem<<endl;
        }
    }
    //else{
        while(zr.size()>1){
            auto it=zr.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            zr.erase(it);
        }

        if(!fl&&zr.size()>0)
            cout<<"2 "<<((*zr.begin()).S)<<endl;

        while(ng.size()>1){
            auto it=ng.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ng.erase(it);
        }

        while(ps.size()>1){
            auto it=ps.begin();
            int in=it->S;
            it++;
            int inn=it->S;
            cout<<"1 "<<in<<" "<<inn<<endl;
            it--;
            ps.erase(it);
        }

        if(ps.size()>0&&ng.size()>0){
            cout<<"1 "<<((*ng.begin()).S)<<" "<<((*ps.begin()).S)<<endl;
        }
    //}

    return 0;
}


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size() > 1)
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            if (c.size() && b.size())
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    else{
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }

    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size()){
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            }
            if (c.size() && b.size()){
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            }
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size())
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[1].S << " " << b[i].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size()){
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            }
            if (c.size() && b.size()){
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            }
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size())
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    cout << "2 " << b[0].S << "\n";
    if (b.size() > 2)
        for (int i = 2; i < b.size(); i++)
            cout << "1 " << b[1].S << " " << b[i].S << "\n";
    if (b.size() > 1 && c.size())
        cout << "1 " << b[1].S << " " << c[0].S << "\n";
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    if (c.size() > 1){
        for (int i = 1; i < c.size(); i++)
            cout << "1 " << c[i].S << " " << c[0].S << "\n";
    }
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        if (d.size() > 1)
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size() > 1)
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            if (c.size() && b.size())
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else{
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    if (c.size() > 1){
        for (int i = 1; i < c.size(); i++)
            cout << "1 " << c[i].S << " " << c[0].S << "\n";
    }
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        if (d.size() > 1)
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size() || (b.size() - 1))
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size() > 1)
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            if (c.size() && b.size())
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else{
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        for (int i = 1; i < b.size(); i++)
            cout << "1 " << b[i].S << " " << b[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size()){
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            }
            if (c.size() && b.size()){
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            }
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size())
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[1].S << " " << b[i].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    if (c.size()){
        for (int i = 1; i < c.size(); i++)
            cout << "1 " << c[i].S << " " << c[0].S << "\n";
    }
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size() > 1)
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            if (c.size() && b.size())
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else{
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size() > 1)
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            if (c.size() && b.size())
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    cout << "2 " << b[0].S << "\n";
    if (b.size() > 2)
        for (int i = 2; i < b.size(); i++)
            cout << "1 " << b[i].S << " " << b[1].S << "\n";
    if (b.size() > 1 && c.size())
        cout << "1 " << b[1].S << " " << c[0].S << "\n";
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size() > 1)
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            if (c.size() && b.size())
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else{
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        for (int i = 1; i < b.size(); i++)
            cout << "1 " << b[i].S << " " << b[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size()){
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
                cout << "1 " << b[0].S << " " << d[0].S << "\n";
            }
            if (c.size()){
                cout << "1 " << c[0].S << " " << d[0].S << "\n";
            }
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size())
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[1].S << " " << b[i].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size()){
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            }
            if (c.size() && b.size()){
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            }
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size())
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[1].S << " " << b[i].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size() > 1)
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            if (c.size() && b.size())
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    else if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    for (int i = 1; i < c.size(); i++)
        cout << "1 " << c[i].S << " " << c[0].S << "\n";
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        for (int i = 1; i < b.size(); i++)
            cout << "1 " << b[i].S << " " << b[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            cout << "2 " << d[0].S << "\n";
            if (b.size()){
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            }
            if (c.size() && b.size()){
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            }
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size())
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[1].S << " " << b[i].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


/* Be strong, be fearless, be beautiful :D
And believe that anything is possible :))
when you have the right people there
to support you :) */
//RTn_E
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define _Sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define _file freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
#define ld long double
#define sp setprecision
#define pb push_back
#define F first
#define S second
#define mk make_pair
#define pii pair < int , int >
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod = 1e9 + 7;
const int maxn = 1e6 + 100;
const ll inf = 1e18;

//Main CODE :/\

vector < pii > b , c , d;
int a[maxn];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (a[i] < 0)
            b.pb({a[i] , i});
        else if (a[i] > 0)
            c.pb({a[i] , i});
        else if (!a[i])
            d.pb({a[i] , i});
    }
    sort(b.rbegin() , b.rend());
    sort(c.rbegin() , c.rend());
    if (c.size()){
        for (int i = 1; i < c.size(); i++)
            cout << "1 " << c[i].S << " " << c[0].S << "\n";
    }
    /*
    b -
    c +
    d 0*/
    if (d.size() && b.size() % 2){
        for (int i = 1; i < d.size(); i++)
            cout << "1 " << d[i].S << " " << d[0].S << "\n";
        cout << "1 " << d[0].S << " " << b[0].S << "\n";
        if (c.size())
            cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (c.size() && b.size() > 1)
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else if (d.size()){
        if (d.size() > 1){
            for (int i = 1; i < d.size(); i++)
                cout << "1 " << d[i].S << " " << d[0].S << "\n";
            if (b.size() || c.size())
                cout << "2 " << d[0].S << "\n";
            if (b.size() > 1)
                for (int i = 1; i < b.size(); i++)
                    cout << "1 " << b[i].S << " " << b[0].S << "\n";
            if (c.size() && b.size())
                cout << "1 " << c[0].S << " " << b[0].S << "\n";
            return 0;
        }
        cout << "2 " << d[0].S << "\n";
        if (b.size() > 1)
            for (int i = 1; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[0].S << "\n";
        if (c.size() && b.size())
            cout << "1 " << b[0].S << " " << c[0].S << "\n";
        return 0;
    }
    if (b.size() % 2){
        cout << "2 " << b[0].S << "\n";
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
        return 0;
    }
    else{
        if (b.size() > 2)
            for (int i = 2; i < b.size(); i++)
                cout << "1 " << b[i].S << " " << b[1].S << "\n";
        if (b.size() > 1 && c.size())
            cout << "1 " << b[1].S << " " << c[0].S << "\n";
    }
    return 0;
}
//The_End
//Game Over :D


#include <bits/stdc++.h>
using namespace std;
const int N=1e5 +100;
const double eps=1e-7;
struct node{
    double v,id;
    node(double _v,double _q){v=_v;id=_q;}
    node(){}
    bool operator<(const node&b)const{
        return v<b.v;
    }
}a[N];
void Print(node x,node y)
{
    cout<<1<<" "<<x.id<<" "<<y.id<<endl;
}
void Delet(node x)
{
    cout<<2<<" "<<x.id<<endl;
}
vector<node>v0,v1;///0 - +
set<node>v2;
int main()
{
    ///ij 乘积放j 删了i
    ///随便删一个数 不超过一次
    ///奇数个负数 && 有 0 绝对值最小的负数跟0走 然后删0
    ///偶数个负数
    int n,pos,num;
    ///第一个大于等于0的位置 0的数量
    while(cin>>n)
    {
        for(int i=0;i<n;i++)
            cin>>a[i].v,a[i].id=i+1;
        sort(a,a+n);
        for(int i=0;i<n;i++)
        {
            if(a[i].v>=0)
            {
                pos=i;
                break;
            }
        }
        for(int i=0;i<pos;i++)///-
        {
            v1.push_back(a[i]);
        }
        num=0;
        int t=pos;
        while(abs(a[t].v)<eps&&t<n)///0
        {
            v0.push_back(a[t]);
            num++,t++;
        }
        for(int i=t;i<n;i++)///+
        {
            v2.insert(a[i]);
        }
        if(num)///如果有0 留一个0
        {
            while(num>1)
            {
                node x=v0.back();
                v0.pop_back();
                node y=v0.back();
                Print(x,y);
                num--;
            }
        }
        if(pos==1)///只有一个负数
        {
            Delet(v1.back());///删了 走
            v1.pop_back();
        }
        if(v2.empty())///没有正数
        {
            if(v1.empty())///没有负数 直接走
                continue;
        }
        ///v1 v2都是从小到大的
        if(int(v1.size())&1)///奇数个负数
        {
            if(num)///如果有0
            {
                node x=v1.back();
                node y=v0.back();
                Print(x,y);
                Delet(x);
                num--;
            }
            else///没0
            {
                node x=v1.back();
                Delet(x);
            }
        }
        if(num)
        {
            node x=v0.back();
            Delet(x);
        }
//         删除第二个元素 (vec[1])
//        vec.erase(vec.begin() + 1);
        ///一定剩下偶数个负数
        while(!v1.empty())
        {
            node x=v1[0];
            node y=v1.back();
            Print(x,y);
            v2.insert(node(x.v*y.v,y.id));
//            v2.push_back(x.v*y.v);
            v1.erase(v1.begin());
            v1.erase(--v1.end());
        }
        int sz=v2.size();
        if(sz==0)continue;///其实就是只有0
        while(sz!=1)
        {
            node x=*v2.begin();
            node y=*(--v2.end());
            Print(x,y);
            v2.erase(v2.begin());
            v2.erase(--v2.end());
            v2.insert(node(x.v*y.v,y.id));
            sz=v2.size();
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=1e5 +100;
const double eps=1e-7;
struct node{
    double v,id;
    node(double _v,double _q){v=_v;id=_q;}
    node(){}
    bool operator<(const node&b)const{
        return v<b.v;
    }
}a[N];
void Print(node x,node y)
{
    cout<<1<<" "<<x.id<<" "<<y.id<<endl;
}
void Delet(node x)
{
    cout<<2<<" "<<x.id<<endl;
}
vector<node>v0,v1;///0 - +
set<node>v2;
int main()
{
    ///ij 乘积放j 删了i
    ///随便删一个数 不超过一次
    ///奇数个负数 && 有 0 绝对值最小的负数跟0走 然后删0
    ///偶数个负数
    int n,pos,num;
    ///第一个大于等于0的位置 0的数量
    while(cin>>n)
    {
        for(int i=0;i<n;i++)
            cin>>a[i].v,a[i].id=i+1;
        sort(a,a+n);
        for(int i=0;i<n;i++)
        {
            if(a[i].v>=0)
            {
                pos=i;
                break;
            }
        }
        for(int i=0;i<pos;i++)///-
        {
            v1.push_back(a[i]);
        }
        num=0;
        int t=pos;
        while(abs(a[t].v)<eps&&t<n)///0
        {
            v0.push_back(a[t]);
            num++,t++;
        }
        for(int i=t;i<n;i++)///+
        {
            v2.insert(a[i]);
        }
        if(num)///如果有0 留一个0
        {
            while(num>1)
            {
                node x=v0.back();
                v0.pop_back();
                node y=v0.back();
                Print(x,y);
                num--;
            }
        }
        if(pos==1)///只有一个负数
        {
            Delet(v1.back());///删了 走
            v1.pop_back();
        }
        if(v2.empty())///没有正数
        {
            if(v1.empty())///没有负数 直接走
                continue;
        }
        ///v1 v2都是从小到大的
        if(int(v1.size())&1)///奇数个负数
        {
            if(num)///如果有0
            {
                node x=v1.back();
                node y=v0.back();
                Print(x,y);
                Delet(x);
                num--;
            }
            else///没0
            {
                node x=v1.back();
                Delet(x);
            }
        }
        if(num)
        {
            node x=v0.back();
            Delet(x);
        }
//         删除第二个元素 (vec[1])
//        vec.erase(vec.begin() + 1);
        ///一定剩下偶数个负数
        while(!v1.empty())
        {
            node x=v1[0];
            node y=v1.back();
            Print(x,y);
            v2.insert(node(x.v*y.v,y.id));
//            v2.push_back(x.v*y.v);
            v1.erase(v1.begin());
//            v1.erase(--v1.end());
            v1.pop_back();
        }
        int sz=v2.size();
        if(sz==0)continue;///其实就是只有0
        while(sz!=1)
        {
            node x=*v2.begin();
            node y=*(--v2.end());
            Print(x,y);
            v2.erase(v2.begin());
            v2.erase(--v2.end());
            v2.insert(node(x.v*y.v,y.id));
            sz=v2.size();
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=1e5 +100;
void Print(int x,int y)
{
    cout<<1<<" "<<x<<" "<<y<<endl;
}
void Delet(int x)
{
    cout<<2<<" "<<x<<endl;
}
int a[N];
bool vis[N];
vector<int>v;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n,neg_max,pos,cnt,num;
    while(cin>>n)
    {
        cnt=num=0;
        v.clear();
        memset(vis,0,sizeof(vis));
        neg_max=INT_MIN;
        for(int i=1;i<=n;i++)
        {
            cin>>a[i];
            if(a[i]==0)
            {
                vis[i]=1;
                v.push_back(i);
                num++;
            }
            if(a[i]<0)
            {
                cnt++;
                if(neg_max<a[i])
                {
                    neg_max=a[i];
                    pos=i;
                }
            }
        }
        int l=num;
        if(num==n)///如果全是0
        {
            for(int i=1;i<l;i++)
                Print(i,i+1);
            continue;
        }
        for(int i=0;i<l-1;i++)///把所有0合了 剩下v[l-1]位置的一个
        {
            Print(v[i],v[i+1]);
        }
        if(num&&cnt)///如果有0 有-
        {
            if(cnt&1)
            {
                vis[pos]=1;
                Print(v[l-1],pos);
            }
            Delet(pos);
        }
        else if(!num&&cnt)///没0有-
        {
            vis[pos]=1;
            if(cnt&1)
                Delet(pos);
        }
        else if(num&&!cnt)///有0没-
        {
            Delet(v[l-1]);
        }
        v.clear();
        for(int i=1;i<=n;i++)
        {
            if(!vis[i])
                v.push_back(i);
        }
        l=v.size();
        for(int i=0;i<l-1;i++)
        {
            Print(v[i],v[i+1]);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=1e5 +100;
void Print(int x,int y)
{
    cout<<1<<" "<<x<<" "<<y<<endl;
}
void Delet(int x)
{
    cout<<2<<" "<<x<<endl;
}
vector<int>v0,v1,v2;///0 - +
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n,sz,x,neg_max,pos;
    while(cin>>n)
    {
        v0.clear();
        v1.clear();
        v2.clear();
        neg_max=-1e9;
        pos=-1;
        for(int i=0;i<n;i++)
        {
            cin>>x;
            if(x==0)v0.push_back(i+1);
            else if(x<0)
            {
                if(neg_max<x)
                {
                    neg_max=x;
                    pos=i+1;
                }
                v1.push_back(i+1);
            }
            else if(x>0)v2.push_back(i+1);
        }
        sz=v0.size();///留一个0
        if(sz)
        {
            while(sz!=1)
            {
                Print(v0[sz-1],v0[0]);
                v0.pop_back();
                sz=v0.size();
            }
        }
        if(v1.empty()&&v2.empty())///只有0 结束即可
            continue;
        sz=v1.size();
        if(sz&1)///负数个数的奇偶性以及对最后那个0的处理
        {
            if(!v0.empty())///还有0
            {
                if(v2.empty()&&sz==1)///如果没有+ 并且只有一个- 此时最好的结果就是0
                {
                    Delet(v1[0]);
                    continue;
                }
                Print(pos,v0[0]);
                Delet(v0[0]);
            }
            else
            {
                Delet(pos);
            }
        }
        else
        {
            if(!v0.empty())
            Delet(v0[0]);
        }
        while(sz)
        {
            if(v1[sz-1]==pos)
            {
                v1.pop_back();
                sz=v1.size();
                continue;
            }
            Print(v1[sz-1],v1[0]);
            v1.pop_back();
            v2.push_back(v1[0]);
            if(sz==1)
            {
                sz=0;
                continue;
            }
            v1.erase(v1.begin());
            sz=v1.size();
        }
        sz=v2.size();
        while(sz!=1)
        {
            Print(v2[sz-1],v2[0]);
            v2.pop_back();
            sz=v2.size();
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=2e5 +100;
void Print(int x,int y)
{
    printf("1 %d %d\n",x,y);
//    cout<<1<<" "<<x<<" "<<y<<endl;
}
void Delet(int x)
{
    printf("2 %d\n",x);
//    cout<<2<<" "<<x<<endl;
}
int a[N];
bool vis[N];
vector<int>v;
int main()
{
//    ios::sync_with_stdio(false);
//    cin.tie(0);cout.tie(0);
    int n,neg_max,pos,cnt,num;
//    while(cin>>n)
    while(scanf("%d",&n)!=EOF)
    {
        cnt=num=0;
        v.clear();
        memset(vis,0,sizeof(vis));
        neg_max=INT_MIN;
        for(int i=1;i<=n;i++)
        {
            scanf("%d",&a[i]);
//            cin>>a[i];
            if(a[i]==0)
            {
                vis[i]=1;
                v.push_back(i);
                num++;
            }
            if(a[i]<0)
            {
                cnt++;
                if(neg_max<a[i])
                {
                    neg_max=a[i];
                    pos=i;
                }
            }
        }
        int l=num;
        if(num==n)///如果全是0
        {
            for(int i=1;i<l;i++)
                Print(i,i+1);
            continue;
        }
        for(int i=0;i<l-1;i++)///把所有0合了 剩下v[l-1]位置的一个
        {
            Print(v[i],v[i+1]);
        }
        if(num&&cnt)///如果有0 有-
        {
            if(cnt&1)
            {
                Print(v[l-1],pos);
                if(num+cnt!=n)
                {
                    vis[pos]=1;
                    Delet(pos);
                }
            }
            else
                Delet(v[l-1]);
        }
        else if(!num&&cnt)///没0有-
        {
            if(cnt&1)
            {
                vis[pos]=1;
                Delet(pos);
            }
        }
        else if(num&&!cnt)///有0没-
        {
            Delet(v[l-1]);
        }
        v.clear();
        for(int i=1;i<=n;i++)
        {
            if(!vis[i])
                v.push_back(i);
        }
        l=v.size();
        for(int i=0;i<l-1;i++)
        {
            Print(v[i],v[i+1]);
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=1e5 +100;
const double eps=1e-7;
struct node{
    double v,id;
    node(double _v,double _q){v=_v;id=_q;}
    node(){}
    bool operator<(const node&b)const{
        return v<b.v;
    }
}a[N];
void Print(node x,node y)
{
    cout<<1<<" "<<x.id<<" "<<y.id<<endl;
}
void Delet(node x)
{
    cout<<2<<" "<<x.id<<endl;
}
vector<node>v0,v1;///0 - +
set<node>v2;
int main()
{
    ///ij 乘积放j 删了i
    ///随便删一个数 不超过一次
    ///奇数个负数 && 有 0 绝对值最小的负数跟0走 然后删0
    ///偶数个负数
    int n,pos,num;
    ///第一个大于等于0的位置 0的数量
    while(cin>>n)
    {
        for(int i=0;i<n;i++)
            cin>>a[i].v,a[i].id=i+1;
        sort(a,a+n);
        for(int i=0;i<n;i++)
        {
            if(a[i].v>=0)
            {
                pos=i;
                break;
            }
        }
        for(int i=0;i<pos;i++)///-
        {
            v1.push_back(a[i]);
        }
        num=0;
        int t=pos;
        while(abs(a[t].v)<eps&&t<n)///0
        {
            v0.push_back(a[t]);
            num++,t++;
        }
        for(int i=t;i<n;i++)///+
        {
            v2.insert(a[i]);
        }
        if(num)///如果有0 留一个0
        {
            while(num>1)
            {
                node x=v0.back();
                v0.pop_back();
                node y=v0.back();
                Print(x,y);
                num--;
            }
        }
        if(pos==1)///只有一个负数
        {
            if(num)Print(v0.back(),v1.back());///但是还有0
            Delet(v1.back());///删了 走
            v1.pop_back();
        }
        if(v2.empty())///没有正数
        {
            if(v1.empty())///没有负数 直接走
                continue;
        }
        ///v1 v2都是从小到大的
        if(int(v1.size())&1)///奇数个负数
        {
            if(num)///如果有0
            {
                node x=v1.back();
                node y=v0.back();
                Print(x,y);
                Delet(x);
                num--;
            }
            else///没0
            {
                node x=v1.back();
                Delet(x);
            }
        }
        if(num)
        {
            node x=v0.back();
            Delet(x);
        }
//         删除第二个元素 (vec[1])
//        vec.erase(vec.begin() + 1);
        ///一定剩下偶数个负数
        while(!v1.empty())
        {
            node x=v1[0];
            node y=v1.back();
            Print(x,y);
            v2.insert(node(x.v*y.v,y.id));
//            v2.push_back(x.v*y.v);
            v1.erase(v1.begin());
            v1.erase(v1.end());
        }
        int sz=v2.size();
        if(sz==0)continue;///其实就是只有0
        while(sz!=1)
        {
            node x=*v2.begin();
            node y=*(--v2.end());
            Print(x,y);
            v2.erase(v2.begin());
            v2.erase(--v2.end());
            v2.insert(node(x.v*y.v,y.id));
            sz=v2.size();
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N=2e5 +100;
void Print(int x,int y)
{
    printf("1 %d %d\n",x,y);
//    cout<<1<<" "<<x<<" "<<y<<endl;
}
void Delet(int x)
{
    printf("2 %d\n",x);
//    cout<<2<<" "<<x<<endl;
}
int a[N];
bool vis[N];
vector<int>v;
int main()
{
//    ios::sync_with_stdio(false);
//    cin.tie(0);cout.tie(0);
    int n,neg_max,pos,cnt,num;
//    while(cin>>n)
    while(scanf("%d",&n)!=EOF)
    {
        cnt=num=0;
        v.clear();
        memset(vis,0,sizeof(vis));
        neg_max=INT_MIN;
        for(int i=1;i<=n;i++)
        {
            scanf("%d",&a[i]);
//            cin>>a[i];
            if(a[i]==0)
            {
                vis[i]=1;
                v.push_back(i);
                num++;
            }
            if(a[i]<0)
            {
                cnt++;
                if(neg_max<a[i])
                {
                    neg_max=a[i];
                    pos=i;
                }
            }
        }
        int l=num;
        if(num==n)///如果全是0
        {
            for(int i=1;i<l;i++)
                Print(i,i+1);
            continue;
        }
        for(int i=0;i<l-1;i++)///把所有0合了 剩下v[l-1]位置的一个
        {
            Print(v[i],v[i+1]);
        }
        if(num&&cnt)///如果有0 有-
        {
            if(cnt&1)
            {
                Print(v[l-1],pos);
                if(num+cnt!=n)
                {
                    vis[pos]=1;
                    Delet(pos);
                }
                else
                    continue;
            }
            else
                Delet(v[l-1]);
        }
        else if(!num&&cnt)///没0有-
        {
            if(cnt&1)
            {
                vis[pos]=1;
                Delet(pos);
            }
        }
        else if(num&&!cnt)///有0没-
        {
            Delet(v[l-1]);
        }
        v.clear();
        for(int i=1;i<=n;i++)
        {
            if(!vis[i])
                v.push_back(i);
        }
        l=v.size();
        for(int i=0;i<l-1;i++)
        {
            Print(v[i],v[i+1]);
        }
    }
    return 0;
}