#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
ll n;
cin>>n;
ll a[200010];
for(ll i=0;i<n;i++)
cin>>a[i];
vector<ll> v,s,m;
for(ll i=0;i<n;i++)
{
if(a[i]==0)
{
v.push_back(i);
}
else if(a[i]<0)
{
s.push_back(a[i]);
}
}
ll k,l;
if(s.size()%2!=0)
{
sort(s.begin(),s.end());
for(ll i=0;i<n;i++)
{
if(a[i]==s[s.size()-1])
{
a[i]=0;
v.push_back(i);
break;
}
}
sort(v.begin(),v.end());
}
if(v.size()!=n){
for(ll i=0;i<(v.size()-1);i++)
{
cout<<1<<" "<<v[i]+1<<" "<<v[i+1]+1<<endl;
}
if(v.size()>0)
{
cout<<2<<" "<<v[v.size()-1]+1<<endl;
}
l=n;
for(ll i=0;i<n;i++)
{
if(a[i]!=0)
{
l=i;
break;
}
}
for(ll i=l;i<(n-1);i++)
{
k=(l+1);
while(a[k]==0 && k<n)
{
k++;
if(k>=n)
break;
}
if(k<n)
{
cout<<1<<" "<<l+1<<" "<<k+1<<endl;
l=k;
i=(l-1);
}
}}
else
{
for(ll i=0;i<(v.size()-1);i++)
{
cout<<1<<" "<<v[i]+1<<" "<<v[i+1]+1<<endl;
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKaW50IG1haW4oKQp7Cglpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKCWNvdXQudGllKE5VTEwpOwoJY2luLnRpZShOVUxMKTsKCWxsIG47CgljaW4+Pm47CglsbCBhWzIwMDAxMF07Cglmb3IobGwgaT0wO2k8bjtpKyspCgljaW4+PmFbaV07Cgl2ZWN0b3I8bGw+IHYscyxtOwoJ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