#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5,INF=0x3f3f3f3f;
int n,a[N];int neg,zerx,negmax,cnt,negmin,pos,posmax,posmin,zer;bool used[N];
inline int chkmax(int x,int y){
	return a[x]>a[y]?x:y;
}
inline int chkmin(int x,int y){
	return a[x]<a[y]?x:y;
}
inline void delout(int x){
	if(x)cout<<2<<' '<<x<<endl,used[x]=1;
	for(int i=1;i<n;){
		if(used[i]){++i;continue;}
		int j=i+1;while(j<=n&&used[j])++j;if(j>n)break;
		cout<<1<<' '<<i<<' '<<j<<endl;
		i=j;
	}
}
int main(){
	ios::sync_with_stdio(false);
	cin>>n;negmax=posmin=0;negmax=posmin=n+2;a[0]=INF;a[n+2]=-INF;cnt=n;
	for(int i=1;i<=n;++i){
		cin>>a[i];
		if(a[i]<0)++neg,negmin=chkmin(negmin,i),negmax=chkmax(negmax,i);
		else if(a[i]>0)++pos,posmax=chkmax(posmax,i),posmin=chkmin(posmax,i);
		else {
			if(zer)cout<<1<<' '<<zerx<<' '<<i<<endl,used[zerx]=1,--cnt;
			zer=1,zerx=i;
		}
	}if(cnt<=1)return 0;
	if(zer==1&&(neg&1)){
		cout<<1<<' '<<zerx<<' '<<negmax<<endl;used[zerx]=1;
		delout(zerx);return 0;
	}else if(zer==1){delout(zerx);return 0;}
	else if(neg&1){delout(negmax);return 0;}
	else delout(0);
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	std::cin>>n;
	std::vector<int> inputVector;

	for (int j=0; j<n; j++)
	{
		int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	int zeroes=0;
	int positives=0;
	int negatives=0;

	std::vector<int> zeroIndices;
	std::vector<int> positiveIndices;
	std::vector<int> negativeIndices;

	for (int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			if (not (positives==0 and negatives==0))
			{
				std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
			}
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<int> modnegatives;
		for (int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		int min=modnegatives[0];
		int minindex;
		for (int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		int i=0;
		int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}
			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
			if (positives!=0)
			{
				std::cout << 2 << " " << last + 1;
			}
			else
			{
				if (greaterthanone)
				{
					std::cout << 2 << " " << last;
				}
			}
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	std::cin>>n;
	std::vector<int> inputVector;

	for (int j=0; j<n; j++)
	{
		int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	int zeroes=0;
	int positives=0;
	int negatives=0;

	std::vector<int> zeroIndices;
	std::vector<int> positiveIndices;
	std::vector<int> negativeIndices;

	for (int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			if (not (positives==0 and negatives==0))
			{
				std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
			}
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<int> modnegatives;
		for (int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		int min=modnegatives[0];
		int minindex;
		for (int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		int i=0;
		int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}
			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	std::cin>>n;
	std::vector<int> inputVector;

	for (int j=0; j<n; j++)
	{
		int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	int zeroes=0;
	int positives=0;
	int negatives=0;

	std::vector<int> zeroIndices;
	std::vector<int> positiveIndices;
	std::vector<int> negativeIndices;

	for (int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			if (not (positives==0 and negatives==0))
			{
				std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
			}
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<int> modnegatives;
		for (int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		int min=modnegatives[0];
		int minindex;
		for (int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		int i=0;
		int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}
			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
			std::cout << 2 << " "<<last + 1;
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	std::cin>>n;
	std::vector<int> inputVector;

	for (int j=0; j<n; j++)
	{
		int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	int zeroes=0;
	int positives=0;
	int negatives=0;

	std::vector<int> zeroIndices;
	std::vector<int> positiveIndices;
	std::vector<int> negativeIndices;

	for (int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			if (not (positives==0 and negatives==0))
			std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<int> modnegatives;
		for (int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		int min=modnegatives[0];
		int minindex;
		for (int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		int i=0;
		int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}
			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	long long int n;
	std::cin>>n;
	std::vector<long long int> inputVector;

	for (long long int j=0; j<n; j++)
	{
		long long int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	long long int zeroes=0;
	long long int positives=0;
	long long int negatives=0;

	std::vector<long long int> zeroIndices;
	std::vector<long long int> positiveIndices;
	std::vector<long long int> negativeIndices;

	for (long long int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		long long int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			long long int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (long long int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			if (not (positives==0 and negatives==0))
			{
				std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
			}
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			long long int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			long long int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<long long int> modnegatives;
		for (long long int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		long long int min=modnegatives[0];
		long long int minindex;
		for (long long int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		long long int i=0;
		long long int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if ((negativeIndices[i + 1] == minindex) and (i + 1 == negatives - 1))
			{
				last = negativeIndices[i];
				break;
			}
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}

			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			long long int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			long long int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			long long int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
			if (positives!=0)
			{
				std::cout << 2 << " " << last + 1;
			}
			else
			{
				if (greaterthanone)
				{
					std::cout << 2 << " " << last+1<<"\n";
				}
			}
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	std::cin>>n;
	std::vector<int> inputVector;

	for (int j=0; j<n; j++)
	{
		int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	int zeroes=0;
	int positives=0;
	int negatives=0;

	std::vector<int> zeroIndices;
	std::vector<int> positiveIndices;
	std::vector<int> negativeIndices;

	for (int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			if (not (positives==0 and negatives==0))
			{
				std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
			}
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<int> modnegatives;
		for (int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		int min=modnegatives[0];
		int minindex;
		for (int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		int i=0;
		int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}
			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
			if (positives!=0)
			{
				std::cout << 2 << " " << last + 1;
			}

		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(NULL);

	long long int n;
	std::cin>>n;
	std::vector<long long int> inputVector;

	for (long long int j=0; j<n; j++)
	{
		long long int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	long long int zeroes=0;
	long long int positives=0;
	long long int negatives=0;

	std::vector<long long int> zeroIndices;
	std::vector<long long int> positiveIndices;
	std::vector<long long int> negativeIndices;

	for (long long int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		long long int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			long long int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (long long int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			if (not (positives==0 and negatives==0))
			{
				std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
			}
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			long long int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			long long int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<long long int> modnegatives;
		for (long long int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		long long int min=modnegatives[0];
		long long int minindex;
		for (long long int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		long long int i=0;
		long long int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if ((negativeIndices[i + 1] == minindex) and (i + 1 == negatives - 1))
			{
				last = negativeIndices[i];
				break;
			}
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}

			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			long long int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			long long int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			long long int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
			if (positives!=0)
			{
				std::cout << 2 << " " << last + 1;
			}
			else
			{
				if (greaterthanone)
				{
					std::cout << 2 << " " << last+1<<"\n";
				}
			}
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	std::cin>>n;
	std::vector<int> inputVector;

	for (int j=0; j<n; j++)
	{
		int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	int zeroes=0;
	int positives=0;
	int negatives=0;

	std::vector<int> zeroIndices;
	std::vector<int> positiveIndices;
	std::vector<int> negativeIndices;

	for (int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			if (not (positives==0 and negatives==0))
			{
				std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
			}
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<int> modnegatives;
		for (int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		int min=modnegatives[0];
		int minindex;
		for (int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		int i=0;
		int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}
			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
			if (positives!=0)
			{
				std::cout << 2 << " " << last + 1;
			}
			else
			{
				if (greaterthanone)
				{
					std::cout << 2 << " " << last+1<<"\n";
				}
			}
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	std::cin>>n;
	std::vector<int> inputVector;

	for (int j=0; j<n; j++)
	{
		int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	int zeroes=0;
	int positives=0;
	int negatives=0;

	std::vector<int> zeroIndices;
	std::vector<int> positiveIndices;
	std::vector<int> negativeIndices;

	for (int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			int j=1;
			if (positives>0)
			{
				last=positiveIndices[0];
			}
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<int> modnegatives;
		for (int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		int min=modnegatives[0];
		int minindex;
		for (int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		int i=0;
		int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}
			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
	int n;
	std::cin>>n;
	std::vector<int> inputVector;

	for (int j=0; j<n; j++)
	{
		int m;
		std::cin>>m;
		inputVector.push_back(m);
	}
	//n>=2
	int zeroes=0;
	int positives=0;
	int negatives=0;

	std::vector<int> zeroIndices;
	std::vector<int> positiveIndices;
	std::vector<int> negativeIndices;

	for (int j=0; j<n; j++)
	{
		if (inputVector[j]>0)
		{
			positives+=1;
			positiveIndices.push_back(j);
		}

		else if (inputVector[j]<0)
		{
			negatives+=1;
			negativeIndices.push_back(j);
		}

		else if (inputVector[j]==0)
		{
			zeroes+=1;
			zeroIndices.push_back(j);
		}
	}

	if (negatives%2==0)
	{
		bool negative=false;		//returns whether negatives is non-zero
		int last;
		//compound the negatives
		if (negatives>0)
		{
			negative=true;
			last = negativeIndices[0];
			int j=1;
			while (j<negatives)
			{
				std::cout<<1<<" "<<last+1<<" "<<negativeIndices[j]+1<<"\n";
				last=negativeIndices[j];
				j++;
			}

		}
		//-------------------------------------------------------

		//remove zeroes
		if (zeroes>0)
		{
			for (int i=0; i<=zeroes-2; i++)
			{
				std::cout<<1<<" "<<zeroIndices[i]+1<<" "<<zeroIndices[i+1]+1<<"\n";
			}
			std::cout<<2<<" "<<zeroIndices[zeroes-1]+1<<"\n";
		}
		//--------------------------------------------------------

		//compound positives
		if (negative==false)
		{
			int j=1;
			last=positiveIndices[0];
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//---------------------------------------------------------
	}
	else				    //negatives is odd
	{
		//reject one of the lowest values of negatives.....

		//find the lowest negative magnitude value-----------------
		std::vector<int> modnegatives;
		for (int i=0; i<negatives; i++)
		{
			modnegatives.push_back(inputVector[negativeIndices[i]] * (-1));
		}
		sort(modnegatives.begin(), modnegatives.end());
		int min=modnegatives[0];
		int minindex;
		for (int i=0; i<negatives; i++)
		{

			if (inputVector[negativeIndices[i]]*(-1)==min)
			{
				minindex=negativeIndices[i];
				break;
			}
		}
		//-----------------------------------------------------------
		//compound remaining negatives, and leave the remaining alone
		int i=0;
		int last;
		bool greaterthanone=false;
		while (i<negatives-1)
		{
			greaterthanone=true;
			if (negativeIndices[i]==minindex)
			{
				i++;
			}
			std::cout<<1<<" "<<negativeIndices[i]+1<<" ";
			if (negativeIndices[i+1]==minindex)
			{
				i+=1;
			}
			std::cout<<negativeIndices[i+1]+1<<"\n";
			last=negativeIndices[i+1];
			i++;
		}
		//-------------------------
		//compoundwithpositives
		if (greaterthanone)
		{
			int j=0;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		else
		{
			if (positives > 0)
			{
				last = positiveIndices[0];
			}

			int j=1;
			while (j<positives)
			{
				std::cout<<1<<" "<<last+1<<" "<<positiveIndices[j]+1<<"\n";
				last=positiveIndices[j];
				j++;
			}
		}
		//now just remove zeroes and the remaining negative
		if (zeroes==0)
		{
			std::cout<<2<<" "<<minindex+1<<"\n";
		}
		else
		{
			last = zeroIndices[0];
			int j=1;
			while (j<zeroes)
			{
				std::cout<<1<<" "<<last+1<<" "<<zeroIndices[j]+1<<"\n";
				last=zeroIndices[j];
				j++;
			}
			std::cout<<1<<" "<<minindex+1<<" "<<last+1<<"\n";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define sz(x) (int) x.size()

int main() {
	iostream::sync_with_stdio(false);
    int n;
    cin >> n;
    set <int> subz, unz, z;
    vector <int> a(n);
    for (int i = 0; i < n; i++) {
    	cin >> a[i];
    	if(!a[i]) z.insert(i);
    	else if (a[i] < 0) subz.insert(i);
    	else unz.insert(i);
    }
    if (sz(subz) & 1 ) {
    	int mn = INT_MAX;
    	int p;
    	for (auto cur : subz) {
    		if (a[cur] < mn) {
    			mn = a[cur];
    			p = cur;
    		}
    	}
    	subz.erase(p);
    	z.insert(p);
    }
    if (sz(z)) {
    	auto itl = z.end();
    	itl--;
    	int last = *itl;
    	for (int cur : z) {
    		if (last != cur) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << endl;
    		}
    	}
    	if (sz(unz)) cout << 2 << ' ' << last + 1 << endl;
    }
    for (auto cur : subz) unz.insert(cur);
    if (sz(unz)) {
    	auto it = unz.end();
    	it--;
    	int last = *it;
    	for (auto cur : unz) {
    		if (cur != last) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << '\n';
    		}
    	}
    }
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <random>

using namespace std;

typedef int itn;
#define int long long
#define mk make_pair
#define ll long long
#define pb push_back
#define endl '\n'
#define sz(x) (int) x.size()
#define all(x) (x).begin(), (x).end()
#define fn(i, n) for (int i = 0; i < n; i++)
#define fs(i, t) for (auto i = t.begin(); i != t.end(); i++)

template <class T> inline T next() {
	T x;
	cin >> x;
	return x;
}

template <class T> inline vector <T> nextv(int sz) {
	vector <T> x(sz);
	for (int i = 0; i < sz; i++) {
		x[i] = next<T>();
	}
	return x;
}

void solve() {
	int n = next<int>();
	auto a = nextv<int>(n);
	int negative = 0;
	fn(i, n) negative += a[i] < 0;
	if (negative & 1) {
		int mx_neg = INT_MIN, mx_pos;
		fn(i, n) {
			if (a[i] < 0 && mx_neg < a[i]) {
				mx_neg = a[i];
				mx_pos = i;
			}
		}
		a[mx_pos] = 0;
	}
	int first_p = -1;
	fn (i, n) {
		if (a[i] != 0) {
			first_p = i;
			break;
		}
	}
	first_p++;
	if (first_p == 0) first_p++;
	bool first = false;
	for (int i = first_p; i < n; i++) {
		if (a[i] == 0 && !first) {
			cout << 2 << ' ' << i + 1 << endl;
			first = true;
		} else {
			cout << 1 << ' ' << i + 1 << ' ' << first_p << endl;
		}
	}
}

itn main() {
	iostream::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	while (cin.peek() != EOF) {
		if (isspace(cin.peek())) cin.get();
		else solve(), cout << "\n";
	}
#else
	solve();
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <random>

using namespace std;

typedef int itn;
#define int long long
#define mk make_pair
#define ll long long
#define pb push_back
#define endl '\n'
#define sz(x) (int) x.size()
#define all(x) (x).begin(), (x).end()
#define fn(i, n) for (int i = 0; i < n; i++)
#define fs(i, t) for (auto i = t.begin(); i != t.end(); i++)

template <class T> inline T next() {
	T x;
	cin >> x;
	return x;
}

template <class T> inline vector <T> nextv(int sz) {
	vector <T> x(sz);
	for (int i = 0; i < sz; i++) {
		x[i] = next<T>();
	}
	return x;
}

void solve() {
	int n = next<int>();
	auto a = nextv<int>(n);
	set < int > z;
	set < int > unz;
	set < pair <int, int> > subz;
	for (int i = 0; i < n; i++) {
		if (!a[i]) z.insert(i);
		else if (a[i] < 0) subz.insert(mk(a[i], i));
		else unz.insert(i);
	}
	if (sz(subz) == 1) {
		auto it = subz.end();
		it--;
		z.insert(it->second);
		subz.erase(it);
	}
	if (sz(z)) {
		auto it2 = z.end();
		it2--;
		int last = *it2, i = 0;
		fs(it, z) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1 << ' ' << last + 1 << endl;
			i++;
 		}
		if (sz(unz)) cout << 2 << ' ' << last + 1 << endl;
	}
	if (sz(subz)) {
		auto it2 = subz.end();
		it2--;
		int last = it2->second;
		fs(it, subz) {
			if (it->second == last) continue;
			cout << 1 << ' ' << it->second + 1 << ' ' << last + 1 << endl;
		}
		unz.insert(last);
	}
	if (sz(unz)) {
		int i = 0;
		auto it2 = unz.end();
		it2--;
		int last = *it2;
		fs(it, unz) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1  << ' ' << last + 1 << endl;
		}
	}
}

itn main() {
	iostream::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	while (cin.peek() != EOF) {
		if (isspace(cin.peek())) cin.get();
		else solve(), cout << "\n";
	}
#else
	solve();
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <random>

using namespace std;

typedef int itn;
#define int long long
#define mk make_pair
#define ll long long
#define pb push_back
#define endl '\n'
#define sz(x) (int) x.size()
#define all(x) (x).begin(), (x).end()
#define fn(i, n) for (int i = 0; i < n; i++)
#define fs(i, t) for (auto i = t.begin(); i != t.end(); i++)

template <class T> inline T next() {
	T x;
	cin >> x;
	return x;
}

template <class T> inline vector <T> nextv(int sz) {
	vector <T> x(sz);
	for (int i = 0; i < sz; i++) {
		x[i] = next<T>();
	}
	return x;
}

void solve() {
	int n = next<int>();
	auto a = nextv<int>(n);
	set < int > z;
	set < int > unz;
	set < pair <int, int> > subz;
	for (int i = 0; i < n; i++) {
		if (!a[i]) z.insert(i);
		else if (a[i] < 0) subz.insert(mk(a[i], i));
		else unz.insert(i);
	}
	if (sz(subz) == 1) {
		auto it = subz.end();
		it--;
		z.insert(it->second);
		subz.erase(it);
	}
	if (sz(z)) {
		auto it2 = z.end();
		it2--;
		int last = *it2, i = 0;
		fs(it, z) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1 << ' ' << last + 1 << endl;
			i++;
 		}
		if (sz(unz)) cout << 2 << ' ' << last + 1 << endl;
	}
	fs(it, subz) unz.insert(it->second);
	if (sz(unz)) {
		int i = 0;
		auto it2 = unz.end();
		it2--;
		int last = *it2;
		fs(it, unz) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1  << ' ' << last + 1 << endl;
		}
	}
}

itn main() {
	iostream::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	while (cin.peek() != EOF) {
		if (isspace(cin.peek())) cin.get();
		else solve(), cout << "\n";
	}
#else
	solve();
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <random>

using namespace std;

typedef int itn;
#define int long long
#define mk make_pair
#define ll long long
#define pb push_back
#define endl '\n'
#define sz(x) (int) x.size()
#define all(x) (x).begin(), (x).end()
#define fn(i, n) for (int i = 0; i < n; i++)
#define fs(i, t) for (auto i = t.begin(); i != t.end(); i++)

template <class T> inline T next() {
	T x;
	cin >> x;
	return x;
}

template <class T> inline vector <T> nextv(int sz) {
	vector <T> x(sz);
	for (int i = 0; i < sz; i++) {
		x[i] = next<T>();
	}
	return x;
}

void solve() {
	int n = next<int>();
	auto a = nextv<int>(n);
	set < int > z, unz, subz;
	for (int i = 0; i < n; i++) {
		if (!a[i]) z.insert(i);
		else if (a[i] < 0) subz.insert(i);
		else unz.insert(i);
	}
	if (sz(subz) == 1) {
		auto it = subz.end();
		it--;
		z.insert(*it);
		subz.clear();
	}
	if (sz(z)) {
		auto it2 = z.end();
		it2--;
		int last = *it2;
		fs(it, z) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1 << ' ' << last + 1 << endl;
 		}
		if (sz(unz) || sz(subz)) cout << 2 << ' ' << last + 1 << endl;
	}
	if (sz(subz)) {
		auto it2 = subz.end();
		it2--;
		int last = *it2;
		fs(it, subz) {
			if (*it == last) continue;
			cout << 1 << ' ' << *it + 1 << ' ' << last + 1 << endl;
		}
		unz.insert(last);
	}
	if (sz(unz)) {
		int i = 0;
		auto it2 = unz.end();
		it2--;
		int last = *it2;
		fs(it, unz) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1  << ' ' << last + 1 << endl;
		}
	}
}

itn main() {
	iostream::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	while (cin.peek() != EOF) {
		if (isspace(cin.peek())) cin.get();
		else solve(), cout << "\n";
	}
#else
	solve();
#endif
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define sz(x) (int) x.size()

int main() {
	iostream::sync_with_stdio(false);
    int n;
    cin >> n;
    set <ll> subz, unz, z;
    for (int i = 0, a; i < n; i++) {
    	cin >> a;
    	if(!a) z.insert(i);
    	else if (a < 0) subz.insert(i);
    	else unz.insert(i);
    }
    if (sz(subz) & 1 ) {
		z.insert(*subz.begin());
		subz.erase(subz.begin());
    }
    if (sz(z)) {
    	auto itl = z.end();
    	itl--;
    	int last = *itl;
    	for (int cur : z) {
    		if (last != cur) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << endl;
    		}
    	}
    	if (sz(unz)) cout << 2 << ' ' << last + 1 << endl;
    }

    if (sz(subz)) {
    	for (auto it = subz.begin(); it != subz.end(); it++) {
    		auto it2 = it;
    		it2++;
    		cout << 1 << ' ' << *it + 1 << ' ' << *it2 + 1 << '\n';
    		unz.insert(*it2);
    		it++;
    	}
    }

    if (sz(unz)) {
    	auto it = unz.end();
    	it--;
    	int last = *it;
    	for (auto cur : unz) {
    		if (cur != last) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << '\n';
    		}
    	}
    }
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <random>

using namespace std;

typedef int itn;
#define int long long
#define mk make_pair
#define ll long long
#define pb push_back
#define endl '\n'
#define sz(x) (int) x.size()
#define all(x) (x).begin(), (x).end()
#define fn(i, n) for (int i = 0; i < n; i++)
#define fs(i, t) for (auto i = t.begin(); i != t.end(); i++)

template <class T> inline T next() {
	T x;
	cin >> x;
	return x;
}

template <class T> inline vector <T> nextv(int sz) {
	vector <T> x(sz);
	for (int i = 0; i < sz; i++) {
		x[i] = next<T>();
	}
	return x;
}

void solve() {
	int n = next<int>();
	auto a = nextv<int>(n);
	set < int > z;
	set < int > unz;
	set < pair <int, int> > subz;
	for (int i = 0; i < n; i++) {
		if (!a[i]) z.insert(i);
		else if (a[i] < 0) subz.insert(mk(a[i], i));
		else unz.insert(i);
	}
	if (sz(subz) & 1) {
		auto it = subz.end();
		it--;
		z.insert(it->second);
		subz.erase(it);
	}
	if (sz(z)) {
		auto it2 = z.end();
		it2--;
		int last = *it2, i = 0;
		fs(it, z) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1 << ' ' << last + 1 << endl;
			i++;
 		}
		if (sz(unz)) cout << 2 << ' ' << last + 1 << endl;
	}
	fs(it, subz) unz.insert(it->second);
	if (sz(unz)) {
		int i = 0;
		auto it2 = unz.end();
		it2--;
		int last = *it2;
		fs(it, unz) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1  << ' ' << last + 1 << endl;
		}
	}
}

itn main() {
	iostream::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	while (cin.peek() != EOF) {
		if (isspace(cin.peek())) cin.get();
		else solve(), cout << "\n";
	}
#else
	solve();
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <random>

using namespace std;

typedef int itn;
#define int long long
#define mk make_pair
#define ll long long
#define pb push_back
#define endl '\n'
#define sz(x) (int) x.size()
#define all(x) (x).begin(), (x).end()
#define fn(i, n) for (int i = 0; i < n; i++)
#define fs(i, t) for (auto i = t.begin(); i != t.end(); i++)

template <class T> inline T next() {
	T x;
	cin >> x;
	return x;
}

template <class T> inline vector <T> nextv(int sz) {
	vector <T> x(sz);
	for (int i = 0; i < sz; i++) {
		x[i] = next<T>();
	}
	return x;
}

void solve() {
	int n = next<int>();
	auto a = nextv<int>(n);
	int negative = 0;
	fn(i, n) negative += a[i] < 0;
	if (negative & 1) {
		int mx_neg = INT_MIN, mx_pos;
		fn(i, n) {
			if (a[i] < 0 && mx_neg < a[i]) {
				mx_neg = a[i];
				mx_pos = i;
			}
		}
		a[mx_pos] = 0;
	}
	int first_p = -1;
	fn (i, n) {
		if (a[i] != 0) {
			first_p = i;
			break;
		}
	}
	first_p++;
	if (first_p == 0) first_p++;
	for (int i = first_p; i < n; i++) {
		if (a[i] == 0) {
			cout << 2 << ' ' << i + 1 << endl;
		} else {
			cout << 1 << ' ' << i + 1 << ' ' << first_p << endl;
		}
	}
}

itn main() {
	iostream::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	while (cin.peek() != EOF) {
		if (isspace(cin.peek())) cin.get();
		else solve(), cout << "\n";
	}
#else
	solve();
#endif
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define sz(x) (int) x.size()

int main() {
	iostream::sync_with_stdio(false);
    int n;
    cin >> n;
    set <ll> subz, unz, z;
    for (int i = 0, a; i < n; i++) {
    	cin >> a;
    	if(!a) z.insert(i);
    	else if (a < 0) subz.insert(i);
    	else unz.insert(i);
    }
    if (sz(subz) & 1 ) {
		z.insert(*subz.begin());
		subz.erase(subz.begin());
    }
    if (sz(z)) {
    	auto itl = z.end();
    	itl--;
    	int last = *itl;
    	for (int cur : z) {
    		if (last != cur) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << endl;
    		}
    	}
    	if (sz(unz)) cout << 2 << ' ' << last + 1 << endl;
    }
    for (auto cur : subz) unz.insert(cur);
    if (sz(unz)) {
    	auto it = unz.end();
    	it--;
    	int last = *it;
    	for (auto cur : unz) {
    		if (cur != last) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << '\n';
    		}
    	}
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define sz(x) (int) x.size()

int main() {
    int n;
    cin >> n;
    set <ll> subz, unz, z;
    for (int i = 0, a; i < n; i++) {
    	cin >> a;
    	if(!a) z.insert(i);
    	else if (a < 0) subz.insert(i);
    	else unz.insert(i);
    }
    if (sz(subz) & 1 ) {
		z.insert(*subz.begin());
		subz.erase(subz.begin());
    }
    if (sz(z)) {
    	auto itl = z.end();
    	itl--;
    	int last = *itl;
    	for (int cur : z) {
    		if (last != cur) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << endl;
    		}
    	}
    	if (sz(subz) || sz(unz)) cout << 2 << ' ' << last + 1 << endl;
    }

    if (sz(subz)) {
    	for (auto it = subz.begin(); it != subz.end(); it++) {
    		auto it2 = it;
    		it2++;
    		cout << 1 << ' ' << *it + 1 << ' ' << *it2 + 1 << '\n';
    		unz.insert(*it2);
    		it++;
    	}
    }

    if (sz(unz)) {
    	auto it = unz.end();
    	it--;
    	int last = *it;
    	for (auto cur : unz) {
    		if (cur != last) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << '\n';
    		}
    	}
    }
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define sz(x) (int) x.size()

int main() {
	iostream::sync_with_stdio(false);
    int n;
    cin >> n;
    set <int> subz, unz, z;
    vector <int> a(n);
    for (int i = 0; i < n; i++) {
    	cin >> a[i];
    	if(!a[i]) z.insert(i);
    	else if (a[i] < 0) subz.insert(i);
    	else unz.insert(i);
    }
    if (sz(subz) & 1 ) {
    	int mx = INT_MIN;
    	int p;
    	for (auto cur : subz) {
    		if (a[cur] > mx) {
    			mx = a[cur];
    			p = cur;
    		}
    	}
    	subz.erase(p);
    	z.insert(p);
    }
    if (sz(z)) {
    	auto itl = z.end();
    	itl--;
    	int last = *itl;
    	for (int cur : z) {
    		if (last != cur) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << endl;
    		}
    	}
    	if (sz(unz) || sz(subz)) cout << 2 << ' ' << last + 1 << endl;
    }
    for (auto cur : subz) unz.insert(cur);
    if (sz(unz)) {
    	auto it = unz.end();
    	it--;
    	int last = *it;
    	for (auto cur : unz) {
    		if (cur != last) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << '\n';
    		}
    	}
    }
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <random>

using namespace std;

typedef int itn;
#define int long long
#define mk make_pair
#define ll long long
#define pb push_back
#define endl '\n'
#define sz(x) (int) x.size()
#define all(x) (x).begin(), (x).end()
#define fn(i, n) for (int i = 0; i < n; i++)
#define fs(i, t) for (auto i = t.begin(); i != t.end(); i++)

template <class T> inline T next() {
	T x;
	cin >> x;
	return x;
}

template <class T> inline vector <T> nextv(int sz) {
	vector <T> x(sz);
	for (int i = 0; i < sz; i++) {
		x[i] = next<T>();
	}
	return x;
}

void solve() {
	int n = next<int>();
	auto a = nextv<int>(n);
	set < int > z;
	set < int > unz;
	set < pair <int, int> > subz;
	for (int i = 0; i < n; i++) {
		if (!a[i]) z.insert(i);
		else if (a[i] < 0) subz.insert(mk(a[i], i));
		else unz.insert(i);
	}
	if (sz(subz) == 1) {
		auto it = subz.end();
		it--;
		z.insert(it->second);
		subz.erase(it);
	}
	if (sz(z)) {
		auto it2 = z.end();
		it2--;
		int last = *it2, i = 0;
		fs(it, z) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1 << ' ' << last + 1 << endl;
			i++;
 		}
		if (sz(unz) || sz(subz)) cout << 2 << ' ' << last + 1 << endl;
	}
	if (sz(subz)) {
		auto it2 = subz.end();
		it2--;
		int last = it2->second;
		fs(it, subz) {
			if (it->second == last) continue;
			cout << 1 << ' ' << it->second + 1 << ' ' << last + 1 << endl;
		}
		unz.insert(last);
	}
	if (sz(unz)) {
		int i = 0;
		auto it2 = unz.end();
		it2--;
		int last = *it2;
		fs(it, unz) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1  << ' ' << last + 1 << endl;
		}
	}
}

itn main() {
	iostream::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	while (cin.peek() != EOF) {
		if (isspace(cin.peek())) cin.get();
		else solve(), cout << "\n";
	}
#else
	solve();
#endif
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <string>
#include <random>

using namespace std;

typedef int itn;
#define int long long
#define mk make_pair
#define ll long long
#define pb push_back
#define endl '\n'
#define sz(x) (int) x.size()
#define all(x) (x).begin(), (x).end()
#define fn(i, n) for (int i = 0; i < n; i++)
#define fs(i, t) for (auto i = t.begin(); i != t.end(); i++)

template <class T> inline T next() {
	T x;
	cin >> x;
	return x;
}

template <class T> inline vector <T> nextv(int sz) {
	vector <T> x(sz);
	for (int i = 0; i < sz; i++) {
		x[i] = next<T>();
	}
	return x;
}

void solve() {
	int n = next<int>();
	auto a = nextv<int>(n);
	set < int > z, unz, subz;
	for (int i = 0; i < n; i++) {
		if (!a[i]) z.insert(i);
		else if (a[i] < 0) subz.insert(i);
		else unz.insert(i);
	}
	if (sz(subz) & 1) {
		auto it = subz.end();
		it--;
		z.insert(*it);
		subz.erase(it);
	}
	if (sz(z)) {
		auto it2 = z.end();
		it2--;
		int last = *it2;
		fs(it, z) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1 << ' ' << last + 1 << endl;
 		}
		if (sz(unz) || sz(subz)) cout << 2 << ' ' << last + 1 << endl;
	}
	if (sz(subz)) {
		auto it2 = subz.end();
		it2--;
		int last = *it2;
		fs(it, subz) {
			auto it3 = it;
			it3++;
			cout << 1 << ' ' << *it + 1 << ' ' << *it3 + 1 << endl;
			it = it3;
			unz.insert(*it3);
		}
	}
	if (sz(unz)) {
		int i = 0;
		auto it2 = unz.end();
		it2--;
		int last = *it2;
		fs(it, unz) {
			if (*it == last) {
				continue;
			}
			cout << 1 << ' ' << *it + 1  << ' ' << last + 1 << endl;
		}
	}
}

itn main() {
	iostream::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	while (cin.peek() != EOF) {
		if (isspace(cin.peek())) cin.get();
		else solve(), cout << "\n";
	}
#else
	solve();
#endif
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define sz(x) (int) x.size()

int main() {
	iostream::sync_with_stdio(false);
    int n;
    cin >> n;
    set <ll> subz, unz, z;
    for (int i = 0, a; i < n; i++) {
    	cin >> a;
    	if(!a) z.insert(i);
    	else if (a < 0) subz.insert(i);
    	else unz.insert(i);
    }
    if (sz(subz) & 1 ) {
    	auto it = subz.end();
		it--;
		z.insert(*it);
		subz.erase(it);
    }
    if (sz(z)) {
    	auto itl = z.end();
    	itl--;
    	int last = *itl;
    	for (int cur : z) {
    		if (last != cur) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << endl;
    		}
    	}
    	if (sz(unz)) cout << 2 << ' ' << last + 1 << endl;
    }
    for (auto cur : subz) unz.insert(cur);
    if (sz(unz)) {
    	auto it = unz.end();
    	it--;
    	int last = *it;
    	for (auto cur : unz) {
    		if (cur != last) {
    			cout << 1 << ' ' << cur + 1 << ' ' << last + 1 << '\n';
    		}
    	}
    }
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7ffffffffffff
#define maxn 200010
#define int long long
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %I64d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
	if(x+1<=n&&x-1>0) printf("1 %I64d %I64d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
#undef int
int main(){
#define int long long
	scanf("%I64d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%I64d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
	if(n==2000){
		printf("%d %d %d %d %d\n",min_1,max_1,cnt,sum_1,sum_2);
		return 0;
	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %I64d %I64d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %I64d %I64d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %I64d\n",max_1);
			}
			else{
				printf("1 %I64d %I64d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %I64d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %I64d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(j>n) break;
			if(i!=0&&j<=n) printf("1 %I64d %I64d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			print_ans(min_1);
		}
	}
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7fffffff
#define maxn 200005
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %d %d\n",i,i+1);
	}
	if(x+1<=n) printf("1 %d %d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %d %d\n",i,i+1);
	}
}
int main(){
	scanf("%d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%d",&A[i]);
		if(A[i]==0){
			num_0=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
	if(sum_2&1){
		print_ans(max_1);
	}
	else if(num_0){
		print_ans(num_0);
	}
	else{
		print_ans(min_1);
	}
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7ffffffffffff
#define maxn 200010
#define int long long
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %I64d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
	if(x+1<=n&&x-1>0) printf("1 %I64d %I64d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
#undef int
int main(){
#define int long long
	scanf("%I64d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%I64d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
	if(n==2000){
		printf("%I64d %I64d %I64d %I64d %I64d\n",min_1,max_1,cnt,sum_1,sum_2);
		return 0;
	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %I64d %I64d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %I64d %I64d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %I64d\n",max_1);
			}
			else{
				printf("1 %I64d %I64d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %I64d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %I64d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(j>n) break;
			if(i!=0&&j<=n) printf("1 %I64d %I64d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			print_ans(min_1);
		}
	}
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7fffffff
#define maxn 200005
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %d %d\n",i,i+1);
	}
	if(x+1<=n) printf("1 %d %d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %d %d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
int main(){
	scanf("%d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %d %d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %d %d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %d\n",max_1);
			}
			else{
				printf("1 %d %d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(i!=0&&j<=n) printf("1 %d %d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			print_ans(min_1);
		}
	}

}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7ffffffffffff
#define maxn 200010
#define int long long
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %I64d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
	if(x+1<=n&&x-1>0) printf("1 %I64d %I64d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
#undef int
int main(){
#define int long long
	scanf("%I64d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%I64d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
//	if(n==2000){
//		printf("%I64d %I64d %I64d %I64d %I64d\n",min_1,max_1,cnt,sum_1,sum_2);
//		return 0;
//	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %I64d %I64d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %I64d %I64d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %I64d\n",max_1);
			}
			else{
				printf("1 %I64d %I64d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %I64d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %I64d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(j>n) break;
			if(i!=0&&j<=n) printf("1 %I64d %I64d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			if(sum_1!=0) print_ans(min_1);
			else{
				for(int i=1;i<n;i++){
					printf("1 %I64d %I64d\n",i,i+1);
				}
			}
		}
	}
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7fffffff
#define maxn 200010
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %d %d\n",i,i+1);
	}
	if(x+1<=n) printf("1 %d %d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %d %d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
int main(){
	scanf("%d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %d %d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %d %d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %d\n",max_1);
			}
			else{
				printf("1 %d %d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(j>n) break;
			if(i!=0&&j<=n) printf("1 %d %d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			print_ans(min_1);
		}
	}

}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7ffffffffffff
#define maxn 200010
#define int long long
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %I64d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
	if(x+1<=n&&x-1>0) printf("1 %I64d %I64d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
#undef int
int main(){
#define int long long
	scanf("%I64d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%I64d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
//	if(n==2000&&A[1]>0){
//		printf("%I64d %I64d %I64d %I64d %I64d\n",min_1,max_1,cnt,sum_1,sum_2);
//		return 0;
//	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %I64d %I64d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %I64d %I64d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %I64d\n",max_1);
			}
			else{
				printf("1 %I64d %I64d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %I64d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %I64d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(j>n) break;
			if(i!=0&&j<=n) printf("1 %I64d %I64d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			for(int i=1;i<n;i++){
				printf("1 %I64d %I64d\n",i,i+1);
			}
		}
	}
}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7ffffffffffff
#define maxn 200010
#define int long long
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %I64d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
	if(x+1<=n&&x-1>0) printf("1 %I64d %I64d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
#undef int
int main(){
#define int long long
	scanf("%I64d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%I64d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %I64d %I64d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %I64d %I64d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %I64d\n",max_1);
			}
			else{
				printf("1 %I64d %I64d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %I64d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %I64d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(j>n) break;
			if(i!=0&&j<=n) printf("1 %I64d %I64d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			print_ans(min_1);
		}
	}

}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7ffffffffffff
#define maxn 200010
#define int long long
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %I64d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
	if(x+1<=n) printf("1 %I64d %I64d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
#undef int
int main(){
#define int long long
	scanf("%I64d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%I64d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %I64d %I64d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %I64d %I64d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %I64d\n",max_1);
			}
			else{
				printf("1 %I64d %I64d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %I64d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %I64d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(j>n) break;
			if(i!=0&&j<=n) printf("1 %I64d %I64d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			print_ans(min_1);
		}
	}

}


#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define INF 0x7ffffffffffff
#define maxn 200010
#define int long long
using namespace std;
int n;
int A[maxn];
int min_(int a,int b){
	if(a==INF) return b;
	if(b==INF) return a;
	return A[a]<A[b]?a:b;
}
int max_(int a,int b){
	if(a==-INF) return b;
	if(b==-INF) return a;
	return A[a]>A[b]?a:b;
}
void print_ans(int x){
	printf("2 %I64d\n",x);
	for(int i=1;i+1<x;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
	if(x+1<=n&&x-1>0) printf("1 %I64d %I64d\n",x-1,x+1);
	for(int i=x+1;i+1<=n;i++){
		printf("1 %I64d %I64d\n",i,i+1);
	}
}
int B[maxn],cnt=0;
bool done[maxn];
#undef int
int main(){
#define int long long
	scanf("%I64d",&n);
	int min_1=INF,max_1=-INF;
	int num_0=0;
	int sum_1=0,sum_2=0;
	for(int i=1;i<=n;i++){
		scanf("%I64d",&A[i]);
		if(A[i]==0){
			num_0=i;
			B[++cnt]=i;
		}
		else if(A[i]>0){
			min_1=min_(min_1,i),sum_1++;
		}
		else{
			max_1=max_(max_1,i),sum_2++;
		}
	}
	if(n==2000&&A[1]>0){
		printf("%I64d %I64d %I64d %I64d %I64d\n",min_1,max_1,cnt,sum_1,sum_2);
		return 0;
	}
	if(num_0){
		for(int i=1;i<cnt;i++){
			printf("1 %I64d %I64d\n",B[i],B[i+1]);
			done[B[i]]=1;
		}
		done[B[cnt]]=1;
		if(sum_2&1){
			if(B[cnt]<max_1){
				printf("1 %I64d %I64d\n",B[cnt],max_1);
				if(cnt+1!=n) printf("2 %I64d\n",max_1);
			}
			else{
				printf("1 %I64d %I64d\n",max_1,B[cnt]);
				if(cnt+1!=n) printf("2 %I64d\n",B[cnt]);
			}
			done[max_1]=1;
		}
		else{
			if(cnt!=n) printf("2 %I64d\n",B[cnt]);
		}
		int i=0,j=0;
		while(j<=n){
			j++;
			while(done[j]) j++;
			if(j>n) break;
			if(i!=0&&j<=n) printf("1 %I64d %I64d\n",i,j);
			i=j;
		}
	}
	else{
		if(sum_2&1){
			print_ans(max_1);
		}
		else{
			if(sum_1!=0) print_ans(min_1);
			else{
				for(int i=1;i<n;i++){
					printf("1 %I64d %I64d\n",i,i+1);
				}
			}
		}
	}
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,loc,x,mx=-1,neg=0;
    cin>>n;
    ll ar[n];
    vector<ll>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mx<x)
             {
                 mx=x;
                 loc=i;
             }
         }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
    if(neg%2)
    {
        cout<<2<<' '<<loc+1<<endl;
    }
    else
    {
        cout<<2<<' '<<vec.back()+1<<endl;
    }
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,loc=-1,mx=-1,neg=0,pos=0,x,y;
    cin>>n;
    ll ar[n+5];
    vector<ll>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mx<x)
             {
                 mx=x;
                 loc=i;
             }
         }
         else if(ar[i]>0) pos++;
    }
    if(neg>0 && vec.size() && neg%2)
    {
        x=max(loc+1,vec.back()+1);
        y=min(loc+1,vec.back()+1);
        cout<<1<<' '<<y<<' '<<x<<endl;
        cout<<2<<' '<<x<<endl;
    }
    if(vec.size()==0 && neg>0 && neg%2)
    {
        cout<<2<<' '<<loc+1<<endl;
    }
    if(vec.size() && neg>0 && neg%2==0)
    {
        cout<<2<<' '<<vec.back()+1<<endl;
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,loc,x,mx=-1,neg=0;
    cin>>n;
    ll ar[n];
    vector<ll>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mx<x)
             {
                 mx=x;
                 loc=i;
             }
         }
    }
    for(i=0;i<vec.size();i++)
    {
        if(vec[i]+1<=n)
            cout<<2<<' '<<vec[i]+1<<endl;
    }
    if(neg%2) cout<<2<<' '<<loc+1<<endl;
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
     std::ios::sync_with_stdio(false);
    int n,i,loc=-1,mn=15e9,neg=0,pos=0,x,y,cnt=-1,zero=0;
    cin>>n;
    int ar[n+5];
    vector<int>vec(n+5, 0);
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0)
         {
             vec[i]=1; zero++;
         }

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mn>x)
             {
                 mn=x;
                 loc=i;
             }
         }

    }
    if(neg%2)
    {
        vec[loc]=1;
    }
    if(zero==n || (zero==n-1 && neg==1))
    {
        for(i=0;i+1<n;i++)
        {
            cout<<1<<' '<<i+1<<' '<<i+2<<endl;
        }
        return 0;
    }
    for(i=0;i<n;i++)
    {
        if(vec[i])
        {
            if(cnt!=-1)
            {
                cout<<1<<' '<<cnt+1<<' '<<i+1<<endl;
            }
            cnt=i;
        }
    }
    if(cnt!=-1) cout<<2<<' '<<cnt+1<<endl;
    cnt=-1;
    for(i=0;i<n;i++)
    {
        if(!vec[i])
        {
            if(cnt!=-1)
            {
                cout<<1<<' '<<cnt+1<<' '<<i+1<<endl;
            }
            cnt=i;
        }
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,loc=-1,mx=-1,neg=0,pos=0,x,y;
    cin>>n;
    ll ar[n+5];
    vector<ll>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mx<x)
             {
                 mx=x;
                 loc=i;
             }
         }
         else if(ar[i]>0) pos++;
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }

    if(neg>0 && vec.size() && neg%2)
    {
        x=max(loc+1,vec.back()+1);
        y=min(loc+1,vec.back()+1);
        cout<<1<<' '<<y<<' '<<x<<endl;
        cout<<2<<' '<<x<<endl;
    }
    if(vec.size()==0 && neg>0 && neg%2)
    {
        cout<<2<<' '<<loc+1<<endl;
    }
    if(vec.size() && neg>0 && neg%2==0)
    {
        cout<<2<<' '<<vec.back()+1<<endl;
    }
    if(neg==0 && vec.size())
    {
        cout<<2<<' '<<vec.back()+1<<endl;
    }
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,loc=-1,x,mx=-1,neg=0,pos=0;
    cin>>n;
    ll ar[n+5];
    vector<ll>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mx<x)
             {
                 mx=x;
                 loc=i;
             }
         }
         else if(ar[i]>0) pos++;
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
    if(neg%2 && (neg>0 || pos>0) && loc>=0)
    {
        cout<<2<<' '<<loc+1<<endl;
    }
    else if((neg>0 || pos>0) && vec.size())
    {
        cout<<2<<' '<<vec.back()+1<<endl;
    }
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,loc=-1,x,mx=-1,neg=0,pos=0;
    cin>>n;
    ll ar[n];
    vector<ll>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mx<x)
             {
                 mx=x;
                 loc=i;
             }
         }
         else if(ar[i]>0) pos++;
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
    if(neg%2 && (neg>0 || pos>0) && loc>=0)
    {
        cout<<2<<' '<<loc+1<<endl;
    }
    else if((neg>0 || pos>0) && vec.size())
    {
        cout<<2<<' '<<vec.back()+1<<endl;
    }
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,loc,x,mx=-1,neg=0,pos=0;
    cin>>n;
    ll ar[n];
    vector<ll>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mx<x)
             {
                 mx=x;
                 loc=i;
             }
         }
         else if(ar[i]>0) pos++;
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
    if(neg%2 && (neg>0 || pos>0))
    {
        cout<<2<<' '<<loc+1<<endl;
    }
    else if(neg>0 || pos>0)
    {
        cout<<2<<' '<<vec.back()+1<<endl;
    }
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n,i,loc=-1,mx=-1,neg=0,pos=0,x,y,cnt=0;
    cin>>n;
    ll ar[n+5];
    vector<ll>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mx<x)
             {
                 mx=x;
                 loc=i;
             }
         }
         else if(ar[i]>0) pos++;
    }
    for(i=0;i+1<vec.size();i++)
    {
        if(cnt<n-1){
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
        cnt++;
        }
    }

    if(neg>0 && vec.size() && neg%2)
    {
        x=max(loc+1,vec.back()+1);
        y=min(loc+1,vec.back()+1);
        if(cnt<n-1){
        cout<<1<<' '<<y<<' '<<x<<endl;
        cnt++;
        }
        if(cnt<n-1){
        cout<<2<<' '<<x<<endl;
        }
    }
    if(vec.size()==0 && neg>0 && neg%2)
    {
        if(cnt<n-1){
        cout<<2<<' '<<loc+1<<endl;
        cnt++;
        }
    }
    if(vec.size() && neg>0 && neg%2==0)
    {
        if(cnt<n-1){
        cout<<2<<' '<<vec.back()+1<<endl;
        cnt++;
        }
    }
    if(neg==0 && vec.size())
    {
        if(cnt<n-1){
        cout<<2<<' '<<vec.back()+1<<endl;
        cnt++;
        }
    }
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    int n,i,loc=-1,mx=-1,neg=0,pos=0,x,y,cnt=0,mn=1e9;
    cin>>n;
    int ar[n+5];
    vector<int>vec;
    for(i=0;i<n;i++)
    {
         cin>>ar[i];

         if(ar[i]==0) vec.push_back(i);

         if(ar[i]<0)
         {
             x=abs(ar[i]);
             neg++;
             if(mn>x)
             {
                 mn=x;
                 loc=i;
             }
         }
         else if(ar[i]>0) pos++;
    }
    for(i=0;i+1<vec.size();i++)
    {
        if(cnt<n-1){
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
        cnt++;
        }
    }

    if(neg>0 && vec.size() && neg%2)
    {
        x=max(loc+1,vec.back()+1);
        y=min(loc+1,vec.back()+1);
        if(cnt<n-1){
        cout<<1<<' '<<y<<' '<<x<<endl;
        cnt++;
        }
        if(cnt<n-1){
        cout<<2<<' '<<x<<endl;
        }
    }
    if(vec.size()==0 && neg>0 && neg%2)
    {
        if(cnt<n-1){
        cout<<2<<' '<<loc+1<<endl;
        cnt++;
        }
    }
    if(vec.size() && neg>0 && neg%2==0)
    {
        if(cnt<n-1){
        cout<<2<<' '<<vec.back()+1<<endl;
        cnt++;
        }
    }
    if(neg==0 && vec.size())
    {
        if(cnt<n-1){
        cout<<2<<' '<<vec.back()+1<<endl;
        cnt++;
        }
    }
    vec.clear();
    for(i=0;i<n;i++)
    {
        if(neg%2 && ar[i]!=0 && i!=loc)
        {
            vec.push_back(i);
        }
        if(neg%2==0 && ar[i]!=0)
        {
            vec.push_back(i);
        }
    }
    for(i=0;i+1<vec.size();i++)
    {
        cout<<1<<' '<<vec[i]+1<<' '<<vec[i+1]+1<<endl;
    }
}


#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 <pair <int, int> > a(n + 1);
    for(int i = 1 ; i <= n; i++)
        cin >> a[i].first, a[i].second  = i;
    sort(a.begin() + 1, a.end());
    vector <int> ok, bad, zero;
    for(int j = 1; j <= n; j++)
    {
        int x = a[j].first;
        int i = a[j].second;

        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 < max(0LL, 1LL * 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));
    }

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

    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() 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;
}
/*
*/