#include <bits/stdc++.h>
#define inp freopen("data.inp","r",stdin)
#define out freopen("data.out","w",stdout)
#define ll long long
#define ull unsigned long long
#define db double
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define st first
#define nd second
#define inc(i,a,b) for (int i=(int)a; i<=(int)b; i++)
#define dec(i,a,b) for (int i=(int)a; i>=(int)b; i--)
#define inf (int)(2e9)
#define mod (int)(1e9+7)
#define pts(a) setprecision(a) << fixed
#define ln "\n"
#define readln scanf("\n")
#define free(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;

int n,m,d,lo,hi,ans;
string a,b,res;

void f(int pos,int x,int y) {
	if (pos>=n) {
		int md=0,ok=0,cnt=0;
		for (int i=1; i<n; i+=2) cnt++;
		for (int i=0; i<n; i++) {
			if (res[i]==char(d+48)) {
				if (i%2==1) ok++; else { ok=-1; break; }
			}
		}
		if (ok==cnt) {
			inc(i,0,n-1) {
				md=(md*10+res[i]-'0')%m;
			}
			if ((md==0)&&(a<=res)&&(res<=b)) {
				ans=(ans+1)%mod;
			}
		}
	} else {
		if (x==1) lo=a[pos]-'0'; else lo=0;
		if (y==1) hi=b[pos]-'0'; else hi=9;
		inc(i,lo,hi) {
			int xx=0,yy=0;
			if ((x==1)&&(i==lo)) xx=1;
			if ((y==1)&&(i==hi)) yy=1;
			res[pos]=char(i+48);
			f(pos+1,xx,yy);
		}
	}
}

int main() {
	cin >> m >> d >> a >> b;
	n=max(a.size(),b.size());
	res="";
	while (res.size()<n) res=res+"0";
	f(0,1,1);
	cout << ans << ln;
}


#include <bits/stdc++.h>
#define inp freopen("data.inp","r",stdin)
#define out freopen("data.out","w",stdout)
#define ll long long
#define ull unsigned long long
#define db double
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define st first
#define nd second
#define inc(i,a,b) for (int i=(int)a; i<=(int)b; i++)
#define dec(i,a,b) for (int i=(int)a; i>=(int)b; i--)
#define inf (int)(2e9)
#define mod (int)(1e9+7)
#define pts(a) setprecision(a) << fixed
#define ln "\n"
#define readln scanf("\n")
#define free(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;

int n,m,d,lo,hi,ans;
string a,b,res;

void f(int pos,int x,int y) {
	if (pos>=n) {
		int md=0;
		inc(i,0,n-1) {
			md=(md*10+res[i]-'0')%m;
		}
		if ((md==0)&&(a<=res)&&(res<=b)) ans=(ans+1)%mod;
	} else {
		if (x==1) lo=a[pos]-'0'; else lo=0;
		if (y==1) hi=b[pos]-'0'; else hi=9;
		inc(i,lo,hi) {
			int xx=0,yy=0;
			if ((x==1)&&(i==lo)) xx=1;
			if ((y==1)&&(i==hi)) yy=1;
			if (i!=d) {
				res[pos]=char(i+48);
				f(pos+2,xx,yy);
				res[pos]='0';
			}
		}
	}
}

int main() {
	cin >> m >> d >> a >> b;
	n=max(a.size(),b.size());
	res="";
	while (res.size()<n) res=res+"0";
	for (int i=1; i<n; i+=2) res[i]=char(d+48);
	f(0,1,1);
	cout << ans << ln;
}


#include <bits/stdc++.h>
#define inp freopen("data.inp","r",stdin)
#define out freopen("data.out","w",stdout)
#define ll long long
#define ull unsigned long long
#define db double
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define st first
#define nd second
#define inc(i,a,b) for (ll i=(ll)a; i<=(ll)b; i++)
#define dec(i,a,b) for (ll i=(ll)a; i>=(ll)b; i--)
#define inf (ll)(2e9)
#define mod (ll)(1e9+7)
#define pts(a) setprecision(a) << fixed
#define ln "\n"
#define readln scanf("\n")
#define free(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;

ll n,m,d,ff[2002][2][2][2002];
string a,b,res;

ll f(ll pos,ll x,ll y,ll md) {
	if (pos==n) {
		if (md==0) return 1; else return 0;
	} else {
		if (ff[pos][x][y][md]!=-1) return ff[pos][x][y][md];
		ll lo,hi;
		if (x==1) lo=a[pos]-'0'; else lo=0;
		if (y==1) hi=b[pos]-'0'; else hi=9;
		ll ans=0;
		if (pos%2==1) {
			ll xx=0,yy=0;
			if ((x==1)&&(d==lo)) xx=1;
			if ((y==1)&&(d==hi)) yy=1;

			if ((lo<=d)&&(d<=hi)) {
				res[pos]=char(d+48);
				ans=(ans+f(pos+1,xx,yy,(md*10+d)%m)%mod)%mod;
			}
		} else {
			inc(i,lo,hi)
				if (i!=d) {
					ll xx=0,yy=0;
					if ((x==1)&&(i==lo)) xx=1;
					if ((y==1)&&(i==hi)) yy=1;
					res[pos]=char(i+48);
					ans=(ans+f(pos+1,xx,yy,(md*10+i)%m)%mod)%mod;
				}
		}
		return (ff[pos][x][y][md]=ans);
	}
}

int main() {
	inp; out;
	while (cin >> m >> d >> a >> b) {
		inc(i,0,2000) inc(j,0,1) inc(k,0,1) inc(l,0,2000) ff[i][j][k][l]=-1;
		n=max(a.size(),b.size());
		res="";
		while (res.size()<n) res=res+"0";
		ll aa=f(0,1,1,0);
		cout << aa << ln;
	}
}


#include <bits/stdc++.h>
#define inp freopen("data.inp","r",stdin)
#define out freopen("data.out","w",stdout)
#define ll long long
#define ull unsigned long long
#define db double
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define st first
#define nd second
#define inc(i,a,b) for (int i=(int)a; i<=(int)b; i++)
#define dec(i,a,b) for (int i=(int)a; i>=(int)b; i--)
#define inf (int)(2e9)
#define mod (int)(1e9+7)
#define pts(a) setprecision(a) << fixed
#define ln "\n"
#define readln scanf("\n")
#define free(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;

int n,m,d,lo,hi,ans;
string a,b,res;

void f(int pos,int x,int y,int md) {
	if (pos>=n) {
		if ((md==0)&&(a<=res)&&(res<=b)) ans=(ans+1)%mod;
	} else {
		if (x==1) lo=a[pos]-'0'; else lo=0;
		if (y==1) hi=b[pos]-'0'; else hi=9;
		if (pos%2==1) {
			int xx=0,yy=0;
			if ((x==1)&&(d==lo)) xx=1;
			if ((y==1)&&(d==hi)) yy=1;
			if ((lo<=d)&&(d<=hi)) {
				res[pos]=char(d+48);
				f(pos+1,xx,yy,(md*10+d)%m);
			} else return;
		} else {
			inc(i,lo,hi) {
				int xx=0,yy=0;
				if ((x==1)&&(i==lo)) xx=1;
				if ((y==1)&&(i==hi)) yy=1;
				if (i!=d) {
					res[pos]=char(i+48);
					f(pos+1,xx,yy,(md*10+i)%m);
				}
			}
		}
	}
}

int main() {
	cin >> m >> d >> a >> b;
	n=max(a.size(),b.size());
	res="";
	while (res.size()<n) res=res+"0";
	f(0,1,1,0);
	cout << ans << ln;
}


#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <stdlib.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <numeric>
#include <utility>
#include <deque>
#include <stack>
#include <bitset>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <queue>
#include <limits>
#include <fstream>
#include <list>
#include <sstream>
#include <iostream>
#include <iomanip>

using namespace std;
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pii pair<int , int >
#define psi pair<string , int>
#define all( x ) x.begin(),x.end()
int MIN( int a , int b ){ return ( a < b ) ? a : b; }
int MAX( int a , int b ){ return ( a < b ) ? b : a; }
string toStr(int n){string s;ostringstream buffer;buffer<<n;s=buffer.str();return s;}
int toInt(string str){int n;istringstream buffer(str);buffer>>n;return n;}
long long pot(long long a,long long b){if(!b)return 1;if(b&1)return a*pot(a*a,b>>1); else return pot(a*a,b>>1);}
#define MOD 1000000007
#define MAX 2001
int m, d, n;
int dp[ MAX ][2][2][MAX];
int ten[ MAX ];
int solve(string &digit, int pos, bool flag, bool is_correct, int val, string test = "" ){

    if( pos == n ){
        //cout<<digit<<" "<<pos<<" "<<is_correct<<" "<<val<<" "<<test<<endl;
        if( is_correct && val == 0 ){
            //cout<<digit<<" "<<pos<<" "<<is_correct<<" "<<val<<" "<<test<<endl;
            return 1;
        }
        return 0;
    }

    if(dp[pos][flag][is_correct][val] != -1 )
        return dp[pos][flag][is_correct][val];

    int maxDigit = digit[ pos ] - '0' , i , aux;
    if( flag ) maxDigit = 9;
    int ans = 0, res;
    for( i = 0 ; i <= maxDigit ; ++i ){
        int new_val = (val % m + ten[n - pos - 1] % m * i % m) % m;
        res = solve( digit , pos + 1, flag | ( ( i < (digit[ pos ]-'0') )?1:0 ) , is_correct & ((pos & 1)?(i == d):(i!=d)) , new_val, test + (char)(i + '0') );
        ans = (ans % MOD + res % MOD) % MOD;
    }
    return dp[pos][flag][is_correct][val] = ans;
}

bool is_correct(string A){
    int val = 0;
    for( int i = 0 ; i < n ; ++i ){
        if( i & 1 ){
            if( A[i] - '0' != d ) return false;
        }else if( A[i] - '0' == d ) return false;
        val = (val % m + ten[n - i - 1] % m * (A[i]-'0') % m) % m;
    }
    return val == 0;
}

int main(){
    string A, B;

    scanf("%d %d" , &m , &d );
    cin>>A>>B;
    //A = "1"; B = "9";
    //for( int i = 1 ; i < 2000 ; ++i ) A += "0", B += "9";
    n = A.size();

    ten[0] = 1;
    for( int i = 1 ; i <= n ; ++i ) ten[i] = (ten[i - 1] % m * 10 % m) % m;

    memset(dp, -1, sizeof(dp));
    int ans = solve(B, 0, 0, 1, 0);
    memset(dp, -1, sizeof(dp));
    //cout<<ans<<endl;
    ans = (ans % MOD - solve(A, 0 , 0, 1 ,0) % MOD + MOD) % MOD;
    cout<<(ans + is_correct(A)) % MOD<<endl;

    return 0;
}

// 1473449578934


#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <stdlib.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <numeric>
#include <utility>
#include <deque>
#include <stack>
#include <bitset>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <queue>
#include <limits>
#include <fstream>
#include <list>
#include <sstream>
#include <iostream>
#include <iomanip>

using namespace std;
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pii pair<int , int >
#define psi pair<string , int>
#define all( x ) x.begin(),x.end()
int MIN( int a , int b ){ return ( a < b ) ? a : b; }
int MAX( int a , int b ){ return ( a < b ) ? b : a; }
string toStr(int n){string s;ostringstream buffer;buffer<<n;s=buffer.str();return s;}
int toInt(string str){int n;istringstream buffer(str);buffer>>n;return n;}
long long pot(long long a,long long b){if(!b)return 1;if(b&1)return a*pot(a*a,b>>1); else return pot(a*a,b>>1);}
#define MOD 1000000007
#define MAX 2001
int m, d, n;
int dp[ MAX ][2][2][MAX];
int ten[ MAX ];
string digit;
int solve(int pos, bool flag, bool is_correct, int val){

    if( pos == n ){
        if( is_correct && val == 0 )
            return 1;
        return 0;
    }

    if(dp[pos][flag][is_correct][val] != -1 )
        return dp[pos][flag][is_correct][val];

    int maxDigit = digit[ pos ] - '0' , i , aux;
    if( flag ) maxDigit = 9;
    int ans = 0, res;
    for( i = 0 ; i <= maxDigit ; ++i ){
        int new_val = (val % m + ten[n - pos - 1] % m * i % m) % m;
        res = solve( pos + 1, flag | ( ( i < (digit[ pos ]-'0') )?1:0 ) , is_correct & ((pos & 1)?(i == d):(i!=d)) , new_val);//, test + (char)(i + '0') );
        ans = (ans % MOD + res % MOD) % MOD;
    }
    return dp[pos][flag][is_correct][val] = ans;
}

bool is_correct(string A){
    int val = 0;
    for( int i = 0 ; i < n ; ++i ){
        if( i & 1 ){
            if( A[i] - '0' != d ) return false;
        }else if( A[i] - '0' == d ) return false;
        val = (val % m + ten[n - i - 1] % m * (A[i]-'0') % m) % m;
    }
    return val == 0;
}

int main(){
    string A, B;
    //m = 1; d = 1;
    scanf("%d %d" , &m , &d );
    cin>>A>>B;
    //A = "1"; B = "9";
    //for( int i = 1 ; i < 2000 ; ++i ) A += "0", B += "9";
    n = A.size();

    ten[0] = 1;
    for( int i = 1 ; i <= n ; ++i ) ten[i] = (ten[i - 1] % m * 10 % m) % m;

    memset(dp, -1, sizeof(dp));
    digit = B;
    int ans = solve(0, 0, 1, 0);
    memset(dp, -1, sizeof(dp));
    digit = A;
    ans = (ans % MOD - solve(0 , 0, 1 ,0) % MOD + MOD) % MOD;
    cout<<(ans + is_correct(A)) % MOD<<endl;

    return 0;
}
// 1473450063094


#include <stdio.h>
#include <string.h>

int n, m, d;
char s1[2123], s2[2123];
int a[2123], b[2123];
int pot10[2123];
typedef long long ll;
const ll mod = 1000000007ll;
long long tab[4][2123][2123];
bool been[4][2123][2123];

long long pd(int tp, int i, int x)
{
	if(i == n)
		return x ? 0 : 1;
	if(been[tp][i][x])
		return tab[tp][i][x];
	been[tp][i][x] = true;

	long long retv = 0;

	int lower = 0;
	if(tp == 3 || tp == 2)
		lower = a[i];
	int upper = 9;
	if(tp == 3 || tp == 1)
		upper = b[i];

	for(int j = lower; j <= upper; j++)
	{
		if(i%2 == 1 && j != d)
			continue;
		if(i%2 == 0 && j == d)
			continue;
		int nx = 0;
		if((tp & 2) && j == a[i])
			nx += 2;
		if((tp & 1) && j == b[i])
			nx += 1;
		retv = (retv + pd(nx, i+1, (x + j * pot10[i])%m))% mod;
	}
	return tab[tp][i][x] = retv;
}

int main(void)
{
	scanf("%d %d %s %s", &m, &d, s1, s2);
	n = strlen(s1);
	for(int i = 0; i < n; i++)
		a[i] = s1[i] - '0', b[i] = s2[i] - '0';
	pot10[n-1] = 1;
	for(int i = n-2; i >= 0; i--)
		pot10[i] = (10*pot10[i+1])%m;
	printf("%lld\n", pd(3, 0, 0));
}

// 1473453188145


#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <iterator>

using namespace std;
int n;

int inp_data[2 * 100001];
bool delt[2 * 100001];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;

	int neg_count = 0;
	int zeroz = 0;
	int zeroz_ind = -1;
	bool pos = false;

	for (int i = 0; i < n; i++)
	{
		cin >> inp_data[i];
		if (inp_data[i] < 0)
			neg_count++;
		if (inp_data[i] == 0)
		{
			zeroz++;
			if (zeroz_ind == -1)
				zeroz_ind = i;
		}
		if (inp_data[i] > 0)
			pos = true;
	}
	if (neg_count % 2 == 1)
	{
		if (zeroz == 0)
		{
			int min_ind = -1;
			for (int i = 0; i < n; i++)
			{
				if (inp_data[i] < 0 && (min_ind == -1 || -inp_data[i] < -inp_data[min_ind]))
				{
					min_ind = i;
				}
			}

			int i = min_ind;
			cout << 2 << " " << i + 1 << "\n";
			delt[i] = true;
		}
		else
		{
			int min_ind = -1;
			for (int i = 0; i < n; i++)
			{
				if (inp_data[i] < 0 && (min_ind == -1 || -inp_data[i] < -inp_data[min_ind]))
				{
					min_ind = i;
				}
			}

			int i = min_ind;
			cout << 1 << " " << i + 1 << " " << zeroz_ind + 1 << "\n";
			delt[i] = true;
		}
	}

	if (zeroz > 0)
	{
		for (int i = 0; i < n; i++)
		{
			if (inp_data[i] == 0 && i != zeroz_ind)
			{
				cout << 1 << " " << i + 1 << " " << zeroz_ind + 1 << "\n";
				delt[i] = true;
			}
		}
		if (!(pos == false && neg_count <= 1))
		{
			cout << 2 << " " << zeroz_ind + 1 << "\n";
			delt[zeroz_ind] = true;
		}
	}

	int f = -1;
	for (int i = 0; i < n; i++)
	{
		if (!delt[i])
		{
			if (f == -1)
			{
				f = i;
				continue;
			}
			cout << 1 << " " << i + 1 << " " << f + 1 << "\n";
			delt[i] = true;
		}
	}

	return 0;
}


#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <iterator>

using namespace std;
int n;

int inp_data[2 * 100001];
bool delt[2 * 100001];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;

	int neg_count = 0;
	int zeroz = 0;
	int zeroz_ind = -1;
	bool pos = false;

	for (int i = 0; i < n; i++)
	{
		cin >> inp_data[i];
		if (inp_data[i] < 0)
			neg_count++;
		if (inp_data[i] == 0)
		{
			zeroz++;
			if (zeroz_ind == -1)
				zeroz_ind = i;
		}
		if (inp_data[i] > 0)
			pos = true;
	}
	if (neg_count % 2 == 1)
	{
		if (zeroz == 0)
		{
			for (int i = 0; i < n; i++)
			{
				if (inp_data[i] < 0)
				{
					cout << 2 << " " << i + 1 << "\n";
					delt[i] = true;
					break;
				}
			}
		}
		else
		{
			for (int i = 0; i < n; i++)
			{
				if (inp_data[i] < 0)
				{
					cout << 1 << " " << i + 1 << " " << zeroz_ind + 1 << "\n";
					delt[i] = true;
					break;
				}
			}
		}
	}

	if (zeroz > 0)
	{
		for (int i = 0; i < n; i++)
		{
			if (inp_data[i] == 0 && i != zeroz_ind)
			{
				cout << 1 << " " << i + 1 << " " << zeroz_ind + 1 << "\n";
				delt[i] = true;
			}
		}
		if (!(pos == false && neg_count <= 1))
		{
			cout << 2 << " " << zeroz_ind + 1 << "\n";
			delt[zeroz_ind] = true;
		}
	}

	int f = -1;
	for (int i = 0; i < n; i++)
	{
		if (!delt[i])
		{
			if (f == -1)
			{
				f = i;
				continue;
			}
			cout << 1 << " " << i + 1 << " " << f + 1 << "\n";
			delt[i] = true;
		}
	}

	return 0;
}


#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <iterator>

using namespace std;
int n;

int inp_data[2 * 100001];
bool delt[2 * 100001];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;

	int neg_count = 0;
	int zeroz = 0;
	int zeroz_ind = -1;
	bool pos = false;

	for (int i = 0; i < n; i++)
	{
		cin >> inp_data[i];
		if (inp_data[i] < 0)
			neg_count++;
		if (inp_data[i] == 0)
		{
			zeroz++;
			if (zeroz_ind == -1)
				zeroz_ind = i;
		}
		if (inp_data[i] > 0)
			pos = true;
	}
	if (neg_count % 2 == 1)
	{
		if (zeroz == 0)
		{
			for (int i = 0; i < n; i++)
			{
				if (inp_data[i] < 0)
				{
					cout << 2 << " " << i + 1 << "\n";
					delt[i] = true;
					break;
				}
			}
		}
		else
		{
			int min_ind = -1;
			for (int i = 0; i < n; i++)
			{
				if (inp_data[i] < 0 && (min_ind ==- 1 || -inp_data[i] < -inp_data[min_ind]))
				{
					min_ind = i;
				}
			}

			int i = min_ind;
			cout << 1 << " " << i + 1 << " " << zeroz_ind + 1 << "\n";
			delt[i] = true;
		}
	}

	if (zeroz > 0)
	{
		for (int i = 0; i < n; i++)
		{
			if (inp_data[i] == 0 && i != zeroz_ind)
			{
				cout << 1 << " " << i + 1 << " " << zeroz_ind + 1 << "\n";
				delt[i] = true;
			}
		}
		if (!(pos == false && neg_count <= 1))
		{
			cout << 2 << " " << zeroz_ind + 1 << "\n";
			delt[zeroz_ind] = true;
		}
	}

	int f = -1;
	for (int i = 0; i < n; i++)
	{
		if (!delt[i])
		{
			if (f == -1)
			{
				f = i;
				continue;
			}
			cout << 1 << " " << i + 1 << " " << f + 1 << "\n";
			delt[i] = true;
		}
	}

	return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
long long a[200005];
int main(){
    int n;
    scanf("%d",&n);
    int flag_pos=0,flag_neg=0,flag_zero=0;
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        if(a[i]>0)flag_pos++;
        if(a[i]<0)flag_neg++;
        if(a[i]==0)flag_zero++;
    }
    if(flag_pos==0&&flag_neg==0&&flag_zero==0){//无
        ;
    }
    if(flag_pos==0&&flag_neg==0&&flag_zero>0){//全删
        for(int i=1;i<=n-1;i++){
            printf("2 %d\n",i);
        }
    }
    if(flag_pos==0&&flag_neg>0){//偶数个最小负数相乘,其余删除
        if(flag_neg&1==0){//偶数个负数 所有负数相乘，其余删掉
            int before=0;
            for(int i=1;i<=n;i++){
                if(a[i]<0){//是负数
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    printf("2 %d\n",i);
                }
            }

        }
        else{//奇数个负数 删掉最大的负数，剩下的负数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){//寻找最小的位置
                if(a[i]<0){
                    if(!nmax){
                        nmax=a[i];
                        pos=i;
                    }
                    else{
                        if(nmax<a[i]){
                            pos=i;
                            nmax=a[i];
                        }
                    }
                }
            }
            if(flag_neg==1){//只有一个负数
                int flag_ne=0;
                for(int i=1;i<=n;i++){
                    if(a[i]<0){
                        printf("2 %d\n",i);
                    }
                    else if(!flag_ne){
                        flag_ne=1;
                    }
                    else{
                        printf("2 %d\n",i);
                    }

                }
            }
            else{//多个负数
                int before=0;
                for(int i=1;i<=n;i++){
                    if(i==pos){
                        printf("2 %d\n",i);
                    }
                    else if(a[i]<0){
                        if(before){
                            printf("1 %d %d\n",before,i);
                        }
                        before=i;
                    }
                    else{
                        printf("2 %d\n",i);
                    }
                }
            }

        }
    }
    if(flag_pos>0&&flag_neg==0){//所有正数相乘，其余删掉
        int before=0;
        for(int i=1;i<=n;i++){
            if(a[i]>0){
                if(before){
                    printf("1 %d %d\n",before,i);
                }
                before=i;
            }
            else{
                printf("2 %d\n",i);
            }
        }
    }
    if(flag_pos>0&&flag_neg>0){
        if(flag_neg&1==0){//所有负数正数相乘，其余删掉
            int before=0;
            for(int i=1;i<=n;i++){
                if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    printf("2 %d\n",i);
                }
            }
        }
        else{//删掉最大的负数，剩下的负数正数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){
                if(a[i]<0){
                    if(nmax){
                        if(nmax<a[i]){
                            nmax=a[i];
                            pos=i;
                        }
                    }
                    else{
                        nmax=a[i];
                        pos=i;
                    }
                }
            }
            int before=0;
            for(int i=1;i<=n;i++){
                if(i==pos){
                    printf("2 %d\n",i);
                }
                else if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    printf("2 %d\n",i);
                }

            }
        }

    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
long long a[200005];
int main(){
    int n;
    scanf("%d",&n);
    int flag_pos=0,flag_neg=0,flag_zero=0;
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        if(a[i]>0)flag_pos++;
        if(a[i]<0)flag_neg++;
        if(a[i]==0)flag_zero++;
    }
//    printf("%d %d %d\n",flag_pos,flag_neg,flag_zero);
    /**
    bug   第二种操作应该只能进行一次
    */

    if(flag_pos==0&&flag_neg==0&&flag_zero==0){//无
        ;
    }
    if(flag_pos==0&&flag_neg==0&&flag_zero>0){//全删
        for(int i=2;i<=n;i++){
            printf("1 %d %d\n",i-1,i);
        }
    }
    if(flag_pos==0&&flag_neg>0){//偶数个最小负数相乘,其余删除
        if(flag_neg%2==0){//偶数个负数 所有负数相乘，其余删掉
            int before=0;
            int bef=0;
            for(int i=1;i<=n;i++){
                if(a[i]<0){//是负数
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
            }
            printf("2 %d\n",bef);

        }
        else{//奇数个负数 删掉最大的负数，剩下的负数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){//寻找最小的位置
                if(a[i]<0){
                    if(!nmax){
                        nmax=a[i];
                        pos=i;
                    }
                    else{
                        if(nmax<a[i]){
                            pos=i;
                            nmax=a[i];
                        }
                    }
                }
            }
            int bef=0;
            if(flag_neg==1){//只有一个负数
                int flag_ne=0;
                for(int i=1;i<=n;i++){
                    if(a[i]<0){
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                    else if(!flag_ne){
                        flag_ne=1;
                    }
                    else{
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                }
                printf("2 %d\n",bef);
            }
            else{//多个负数
                int before=0;
                int bef=0;
                for(int i=1;i<=n;i++){
                    if(i==pos){
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                    else if(a[i]<0){
                        if(before){
                            printf("1 %d %d\n",before,i);
                        }
                        before=i;
                    }
                    else{
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                }
                printf("2 %d\n",bef);
            }
        }
    }
    if(flag_pos>0&&flag_neg==0){//所有正数相乘，其余删掉
        int before=0;
        int bef=0;
        for(int i=1;i<=n;i++){
            if(a[i]>0){
                if(before){
                    printf("1 %d %d\n",before,i);
                }
                before=i;
            }
            else{
                if(bef){
                    printf("1 %d %d\n",bef,i);
                }
                bef=i;
            }
        }
        printf("2 %d\n",bef);
    }
    if(flag_pos>0&&flag_neg>0){
        if(flag_neg%2==0){//所有负数正数相乘，其余删掉
//            printf("!~!!\n");
            int before=0;
            for(int i=1;i<=n;i++){
                if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    printf("2 %d\n",i);
                }
            }
        }
        else{//删掉最大的负数，剩下的负数正数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){
                if(a[i]<0){
                    if(nmax){
                        if(nmax<a[i]){
                            nmax=a[i];
                            pos=i;
                        }
                    }
                    else{
                        nmax=a[i];
                        pos=i;
                    }
                }
            }
            int before=0;
            for(int i=1;i<=n;i++){
                if(i==pos){
                    printf("2 %d\n",i);
                }
                else if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    printf("2 %d\n",i);
                }

            }
        }

    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
long long a[200005];
int main(){
    int n;
    scanf("%d",&n);
    int flag_pos=0,flag_neg=0,flag_zero=0;
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        if(a[i]>0)flag_pos++;
        if(a[i]<0)flag_neg++;
        if(a[i]==0)flag_zero++;
    }
//    printf("%d %d %d\n",flag_pos,flag_neg,flag_zero);
    /**
    bug   第二种操作应该只能进行一次
    */

    if(flag_pos==0&&flag_neg==0&&flag_zero==0){//无
        ;
    }
    if(flag_pos==0&&flag_neg==0&&flag_zero>0){//全删
        for(int i=2;i<=n;i++){
            printf("1 %d %d\n",i-1,i);
        }
    }
    if(flag_pos==0&&flag_neg>0){//偶数个最小负数相乘,其余删除
        if(flag_neg%2==0){//偶数个负数 所有负数相乘，其余删掉
            int before=0;
            int bef=0;
            for(int i=1;i<=n;i++){
                if(a[i]<0){//是负数
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
            }
            if(bef)printf("2 %d\n",bef);

        }
        else{//奇数个负数 删掉最大的负数，剩下的负数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){//寻找最小的位置
                if(a[i]<0){
                    if(!nmax){
                        nmax=a[i];
                        pos=i;
                    }
                    else{
                        if(nmax<a[i]){
                            pos=i;
                            nmax=a[i];
                        }
                    }
                }
            }
            int bef=0;
            if(flag_neg==1){//只有一个负数
                int flag_ne=0;
                for(int i=1;i<=n;i++){
                    if(a[i]<0){
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                    else if(!flag_ne){
                        flag_ne=1;
                    }
                    else{
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                }
                if(bef)printf("2 %d\n",bef);
            }
            else{//多个负数
                int before=0;
                int bef=0;
                for(int i=1;i<=n;i++){
                    if(i==pos){
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                    else if(a[i]<0){
                        if(before){
                            printf("1 %d %d\n",before,i);
                        }
                        before=i;
                    }
                    else{
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                }
                printf("2 %d\n",bef);
            }
        }
    }
    if(flag_pos>0&&flag_neg==0){//所有正数相乘，其余删掉
        int before=0;
        int bef=0;
        for(int i=1;i<=n;i++){
            if(a[i]>0){
                if(before){
                    printf("1 %d %d\n",before,i);
                }
                before=i;
            }
            else{
                if(bef){
                    printf("1 %d %d\n",bef,i);
                }
                bef=i;
            }
        }
        if(bef)printf("2 %d\n",bef);
    }
    if(flag_pos>0&&flag_neg>0){
        if(flag_neg%2==0){//所有负数正数相乘，其余删掉
            int before=0;
            int bef=0;
            for(int i=1;i<=n;i++){
                if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
            }
            if(bef)printf("2 %d\n",bef);
        }
        else{//删掉最大的负数，剩下的负数正数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){
                if(a[i]<0){
                    if(nmax){
                        if(nmax<a[i]){
                            nmax=a[i];
                            pos=i;
                        }
                    }
                    else{
                        nmax=a[i];
                        pos=i;
                    }
                }
            }
            int before=0;
            int bef=0;
            for(int i=1;i<=n;i++){
                if(i==pos){
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
                else if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
            }
            if(bef)printf("2 %d\n",bef);
        }

    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
long long a[200005];
int main(){
    int n;
    scanf("%d",&n);
    int flag_pos=0,flag_neg=0,flag_zero=0;
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        if(a[i]>0)flag_pos++;
        if(a[i]<0)flag_neg++;
        if(a[i]==0)flag_zero++;
    }
//    printf("%d %d %d\n",flag_pos,flag_neg,flag_zero);

    if(flag_pos==0&&flag_neg==0&&flag_zero==0){//无
        ;
    }
    if(flag_pos==0&&flag_neg==0&&flag_zero>0){//全删
        for(int i=1;i<=n-1;i++){
            printf("2 %d\n",i);
        }
    }
    if(flag_pos==0&&flag_neg>0){//偶数个最小负数相乘,其余删除
        if(flag_neg%2==0){//偶数个负数 所有负数相乘，其余删掉
            int before=0;
            for(int i=1;i<=n;i++){
                if(a[i]<0){//是负数
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    printf("2 %d\n",i);
                }
            }

        }
        else{//奇数个负数 删掉最大的负数，剩下的负数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){//寻找最小的位置
                if(a[i]<0){
                    if(!nmax){
                        nmax=a[i];
                        pos=i;
                    }
                    else{
                        if(nmax<a[i]){
                            pos=i;
                            nmax=a[i];
                        }
                    }
                }
            }
            if(flag_neg==1){//只有一个负数
                int flag_ne=0;
                for(int i=1;i<=n;i++){
                    if(a[i]<0){
                        printf("2 %d\n",i);
                    }
                    else if(!flag_ne){
                        flag_ne=1;
                    }
                    else{
                        printf("2 %d\n",i);
                    }

                }
            }
            else{//多个负数
                int before=0;
                for(int i=1;i<=n;i++){
                    if(i==pos){
                        printf("2 %d\n",i);
                    }
                    else if(a[i]<0){
                        if(before){
                            printf("1 %d %d\n",before,i);
                        }
                        before=i;
                    }
                    else{
                        printf("2 %d\n",i);
                    }
                }
            }

        }
    }
    if(flag_pos>0&&flag_neg==0){//所有正数相乘，其余删掉
        int before=0;
        for(int i=1;i<=n;i++){
            if(a[i]>0){
                if(before){
                    printf("1 %d %d\n",before,i);
                }
                before=i;
            }
            else{
                printf("2 %d\n",i);
            }
        }
    }
    if(flag_pos>0&&flag_neg>0){
        if(flag_neg%2==0){//所有负数正数相乘，其余删掉
//            printf("!~!!\n");
            int before=0;
            for(int i=1;i<=n;i++){
                if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    printf("2 %d\n",i);
                }
            }
        }
        else{//删掉最大的负数，剩下的负数正数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){
                if(a[i]<0){
                    if(nmax){
                        if(nmax<a[i]){
                            nmax=a[i];
                            pos=i;
                        }
                    }
                    else{
                        nmax=a[i];
                        pos=i;
                    }
                }
            }
            int before=0;
            for(int i=1;i<=n;i++){
                if(i==pos){
                    printf("2 %d\n",i);
                }
                else if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    printf("2 %d\n",i);
                }

            }
        }

    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
long long a[200005];
int main(){
    int n;
    scanf("%d",&n);
    int flag_pos=0,flag_neg=0,flag_zero=0;
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        if(a[i]>0)flag_pos++;
        if(a[i]<0)flag_neg++;
        if(a[i]==0)flag_zero++;
    }
//    printf("%d %d %d\n",flag_pos,flag_neg,flag_zero);
    /**
    bug   第二种操作应该只能进行一次
    */

    if(flag_pos==0&&flag_neg==0&&flag_zero==0){//无
        ;
    }
    if(flag_pos==0&&flag_neg==0&&flag_zero>0){//全删
        for(int i=2;i<=n;i++){
            printf("1 %d %d\n",i-1,i);
        }
    }
    if(flag_pos==0&&flag_neg>0){//偶数个最小负数相乘,其余删除
        if(flag_neg%2==0){//偶数个负数 所有负数相乘，其余删掉
            int before=0;
            int bef=0;
            for(int i=1;i<=n;i++){
                if(a[i]<0){//是负数
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
            }
            printf("2 %d\n",bef);

        }
        else{//奇数个负数 删掉最大的负数，剩下的负数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){//寻找最小的位置
                if(a[i]<0){
                    if(!nmax){
                        nmax=a[i];
                        pos=i;
                    }
                    else{
                        if(nmax<a[i]){
                            pos=i;
                            nmax=a[i];
                        }
                    }
                }
            }
            int bef=0;
            if(flag_neg==1){//只有一个负数
                int flag_ne=0;
                for(int i=1;i<=n;i++){
                    if(a[i]<0){
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                    else if(!flag_ne){
                        flag_ne=1;
                    }
                    else{
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                }
                printf("2 %d\n",bef);
            }
            else{//多个负数
                int before=0;
                int bef=0;
                for(int i=1;i<=n;i++){
                    if(i==pos){
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                    else if(a[i]<0){
                        if(before){
                            printf("1 %d %d\n",before,i);
                        }
                        before=i;
                    }
                    else{
                        if(bef){
                            printf("1 %d %d\n",bef,i);
                        }
                        bef=i;
                    }
                }
                printf("2 %d\n",bef);
            }
        }
    }
    if(flag_pos>0&&flag_neg==0){//所有正数相乘，其余删掉
        int before=0;
        int bef=0;
        for(int i=1;i<=n;i++){
            if(a[i]>0){
                if(before){
                    printf("1 %d %d\n",before,i);
                }
                before=i;
            }
            else{
                if(bef){
                    printf("1 %d %d\n",bef,i);
                }
                bef=i;
            }
        }
        printf("2 %d\n",bef);
    }
    if(flag_pos>0&&flag_neg>0){
        if(flag_neg%2==0){//所有负数正数相乘，其余删掉
            int before=0;
            int bef=0;
            for(int i=1;i<=n;i++){
                if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
            }
            printf("2 %d\n",bef);
        }
        else{//删掉最大的负数，剩下的负数正数相乘，其余删除
            int nmax=0,pos;
            for(int i=1;i<=n;i++){
                if(a[i]<0){
                    if(nmax){
                        if(nmax<a[i]){
                            nmax=a[i];
                            pos=i;
                        }
                    }
                    else{
                        nmax=a[i];
                        pos=i;
                    }
                }
            }
            int before=0;
            int bef=0;
            for(int i=1;i<=n;i++){
                if(i==pos){
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
                else if(a[i]!=0){
                    if(before){
                        printf("1 %d %d\n",before,i);
                    }
                    before=i;
                }
                else{
                    if(bef){
                        printf("1 %d %d\n",bef,i);
                    }
                    bef=i;
                }
            }
            printf("2 %d\n",bef);
        }

    }
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <algorithm>

using namespace std;

pair<int, int> a[200000];

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &a[i].first);
		a[i].second = i + 1;
	}

	sort(a, a + n);

	int negative = 0;
	int positive = 0;

	for (int i = 0; i < n; i++)
		if (a[i].first < 0) ++negative;
		else
			if (a[i].first > 0) ++positive;

	if (positive == 0 && negative < 2)
	{
#ifndef ONLINE_JUDGE
		puts("it is impossible to get positive result: get zero by muliplying all the numbers");
#endif
		for (int i = 1; i < n; i++)
			printf("1 %d %d\n", i, i + 1);
		return 0;
	}
	if (negative + positive == n && (negative & 1) == 0)
	{
#ifndef ONLINE_JUDGE
		puts("there are even number of negative and there is no zeros. multiply all the numbers");
#endif
		for (int i = 1; i < n; i++)
			printf("1 %d %d\n", i, i + 1);
		return 0;
	}

	if (negative & 1) --negative;

#ifndef ONLINE_JUDGE
	printf("multiply %d negative and %d positive numbers\n", negative, positive);
#endif

	int r = a[negative].second;
	for (int i = negative; i < n - 1 && a[i + 1].first == 0; i++)
	{
		printf("1 %d %d\n", a[i].second, a[i + 1].second);
		r = a[i + 1].second;
	}
	for (int i = negative; i < n && a[i].first <= 0; i++)
		a[i].second = -1;

	printf("2 %d\n", r);
	int last = 0;
	while (last < n && a[last].second == -1) ++last;
	for (int i = last + 1; i < n; i++)
	{
		if (a[i].second == -1) continue;
		printf("1 %d %d\n", a[last].second, a[i].second);
		last = i;
	}

	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
#include <queue>
#include <string>
#include <string.h>
#include <map>
#include <vector>
#include <fstream>
using namespace std;
#define N 212345
#define M 401000
//#define MAXN 1125899906842624L
#define MAXVAL 1000000000
#define MAXN 520*520
#define MOD 1000000007
int n, s;
int a[N];
void solve() {
	int i, x = 0, y = 0, z = 0, op = n - 1;
	int m = -1000000001, idx = -1;
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		if (a[i] > 0) {
			x++;
		}
		else if (a[i] == 0) {
			z++;
		}
		else {
			y++;
			if (a[i] > m) {
				m = a[i];
				idx = i;
			}
		}
	}
	if (y % 2) {
		int p = idx + 1;
		for (i = 0; i < n && op; i++) {
			if (a[i] == 0) {
				printf("1 %d %d\n", p, i+1);
				p = i + 1;
				op--;
			}
		}
		if (op) {
			op--;
			printf("2 %d\n", p);
		}
		if (op) {
			p = -1;
			for (i = 0; i < n && op; i++) {
				if (a[i] != 0 && i != idx) {
					if (p == -1) {
						p = i + 1;
					}
					else {
						printf("1 %d %d\n", p, i + 1);
						p = i + 1;
						op--;
					}
				}
			}
		}
	}
	else {
		int p = -1;
		for (i = 0; i < n && op; i++) {
			if (a[i] == 0) {
				if (p == -1) {
					p = i + 1;
				}
				else {
					printf("1 %d %d\n", p, i + 1);
					p = i + 1;
					op--;
				}
			}
		}
		if (op && p != -1) {
			printf("2 %d\n", p);
			op--;
			p = -1;
		}
		for (i = 0; i < n && op; i++) {
			if (a[i] != 0) {
				if (p == -1) {
					p = i + 1;
				}
				else {
					printf("1 %d %d\n", p, i + 1);
					p = i + 1;
					op--;
				}
			}
		}
	}
}
int main() {
	//int tc;
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	while (scanf("%d", &n) != EOF) {
		solve();
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstring>
#define fuck(x) cout<<#x<<" = "<<x<<endl;
#define ls (t<<1)
#define rs ((t<<1)+1)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn = 100086;
const int inf = 2.1e9;
const ll Inf = 999999999999999999;
const int mod = 1e9+7;
const double eps = 1e-6;
vector<int>zhen,fu,lin;
int main()
{
//    ios::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);

    int n,x;

    scanf("%d",&n);int k=n-1;
    for(int i=1;i<=n;i++){
        scanf("%d",&x);
        if(x==0){lin.push_back(i);}
        else if(x>0){zhen.push_back(i);}
        else{
            fu.push_back(i);
        }
    }
    if(k<=0){return 0;}
    int siz = lin.size();
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",lin[i],lin[i+1]);
        k--;if(k<=0){return 0;}
    }

    siz = fu.size();
    if(siz>1)
    for(int i=0;i+1<siz;i+=2){
//        fuck(i)fuck(siz)
        printf("1 %d %d\n",fu[i],fu[i+1]);
        zhen.push_back(fu[i+1]); k--;if(k<=0){return 0;}
    }

    siz = zhen.size();
    if(siz>1)
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",zhen[i],zhen[i+1]); k--;if(k<=0){return 0;}
    }

    int a,b,c;
    a=b=c=0;
    if(fu.size()&1){a=1;}
    if(zhen.size()>0){b=1;}
    if(lin.size()>0){c=1;}

    if(a&&c){
        printf("1 %d %d\n",lin[lin.size()-1],fu[fu.size()-1]);k--;
        if(k==1){printf("2 %d\n",fu[fu.size()-1]);}
    }
    else if(a&&k==1){
        printf("2 %d\n",fu[fu.size()-1]);
    }
    else if(c&&k==1){
        printf("2 %d\n",lin[lin.size()-1]);
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstring>
#define fuck(x) cout<<#x<<" = "<<x<<endl;
#define ls (t<<1)
#define rs ((t<<1)+1)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn = 100086;
const int inf = 2.1e9;
const ll Inf = 999999999999999999;
const int mod = 1e9+7;
const double eps = 1e-6;
vector<int>zhen,fu,lin;
int x[maxn];
bool cmp(int a,int y)
{
    return x[a]<x[y];
}
int main()
{
//    ios::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);

    int n;

    scanf("%d",&n);int k=n-1;
    for(int i=1;i<=n;i++){
        scanf("%d",&x[i]);
        if(x[i]==0){lin.push_back(i);}
        else if(x[i]>0){zhen.push_back(i);}
        else{
            fu.push_back(i);
        }
    }
    sort(fu.begin(),fu.end());
    if(k<=0){return 0;}
    int siz = lin.size();
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",lin[i],lin[i+1]);
        k--;if(k<=0){return 0;}
    }

    siz = fu.size();
    if(siz>1)
    for(int i=0;i+1<siz;i+=2){
//        fuck(i)fuck(siz)
        printf("1 %d %d\n",fu[i],fu[i+1]);
        zhen.push_back(fu[i+1]); k--;if(k<=0){return 0;}
    }

    siz = zhen.size();
    if(siz>1)
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",zhen[i],zhen[i+1]); k--;if(k<=0){return 0;}
    }

    int a,b,c;
    a=b=c=0;
    if(fu.size()&1){a=1;}
    if(zhen.size()>0){b=1;}
    if(lin.size()>0){c=1;}

    if(a&&c){
        printf("1 %d %d\n",lin[lin.size()-1],fu[fu.size()-1]);k--;
        if(k==1){printf("2 %d\n",fu[fu.size()-1]);}
    }
    else if(a&&k==1){
        printf("2 %d\n",fu[fu.size()-1]);
    }
    else if(c&&k==1){
        printf("2 %d\n",lin[lin.size()-1]);
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstring>
#define fuck(x) cout<<#x<<" = "<<x<<endl;
#define ls (t<<1)
#define rs ((t<<1)+1)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn = 200086;
const int inf = 2.1e9;
const ll Inf = 999999999999999999;
const int mod = 1e9+7;
const double eps = 1e-6;
vector<int>zhen,fu,lin;
int x[maxn];
bool cmp(int a,int y)
{
    return x[a]<x[y];
}
int main()
{
//    ios::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);

    int n;

    scanf("%d",&n);int k=n-1;
    for(int i=1;i<=n;i++){
        scanf("%d",&x[i]);
        if(x[i]==0){lin.push_back(i);}
        else if(x[i]>0){zhen.push_back(i);}
        else{
            fu.push_back(i);
        }
    }
    sort(fu.begin(),fu.end(),cmp);
    if(k<=0){return 0;}
    int siz = lin.size();
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",lin[i],lin[i+1]);
        k--;if(k<=0){return 0;}
    }

    siz = fu.size();
    if(siz>1)
    for(int i=0;i+1<siz;i+=2){
//        fuck(i)fuck(siz)
        printf("1 %d %d\n",fu[i],fu[i+1]);
        zhen.push_back(fu[i+1]); k--;if(k<=0){return 0;}
    }

    siz = zhen.size();
    if(siz>1)
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",zhen[i],zhen[i+1]); k--;if(k<=0){return 0;}
    }

    int a,b,c;
    a=b=c=0;
    if(fu.size()&1){a=1;}
    if(zhen.size()>0){b=1;}
    if(lin.size()>0){c=1;}

    if(a&&c){
        printf("1 %d %d\n",lin[lin.size()-1],fu[fu.size()-1]);k--;
        if(k==1){printf("2 %d\n",fu[fu.size()-1]);}
    }
    else if(a&&k==1){
        printf("2 %d\n",fu[fu.size()-1]);
    }
    else if(c&&k==1){
        printf("2 %d\n",lin[lin.size()-1]);
    }
    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstring>
#define fuck(x) cout<<#x<<" = "<<x<<endl;
#define ls (t<<1)
#define rs ((t<<1)+1)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn = 100086;
const int inf = 2.1e9;
const ll Inf = 999999999999999999;
const int mod = 1e9+7;
const double eps = 1e-6;
vector<int>zhen,fu,lin;
int main()
{
//    ios::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);

    int n,x;
    int k=n-1;
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&x);
        if(x==0){lin.push_back(i);}
        else if(x>0){zhen.push_back(i);}
        else{
            fu.push_back(i);
        }
    }
    if(k<=0){return 0;}
    int siz = lin.size();
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",lin[i],lin[i+1]);
        k--;if(k<=0){return 0;}
    }

    siz = fu.size();
    if(siz>1)
    for(int i=0;i+1<siz;i+=2){
//        fuck(i)fuck(siz)
        printf("1 %d %d\n",fu[i],fu[i+1]);
        zhen.push_back(fu[i+1]); k--;if(k<=0){return 0;}
    }

    siz = zhen.size();
    if(siz>1)
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",zhen[i],zhen[i+1]); k--;if(k<=0){return 0;}
    }

    int a,b,c;
    a=b=c=0;
    if(fu.size()&1){a=1;}
    if(zhen.size()>0){b=1;}
    if(lin.size()>0){c=1;}

    if(a==1&&b==1&&c==1){
        if(k==1){printf("%d %d\n",2,fu[fu.size()-1]);}
        else{
            printf("%d %d %d\n",1,fu[fu.size()-1],lin[lin.size()-1]);
            printf("%d %d\n",2,lin[lin.size()-1]);
        }
    }

        else if(a==1&&b==1&&c==0){
            printf("%d %d\n",2,fu[fu.size()-1]);
        }
    else if(a==0&&b==1&&c==1){
            printf("%d %d\n",2,lin[lin.size()-1]);
        }

    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstring>
#define fuck(x) cout<<#x<<" = "<<x<<endl;
#define ls (t<<1)
#define rs ((t<<1)+1)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn = 100086;
const int inf = 2.1e9;
const ll Inf = 999999999999999999;
const int mod = 1e9+7;
const double eps = 1e-6;
vector<int>zhen,fu,lin;
int main()
{
//    ios::sync_with_stdio(false);
    freopen("in.txt","r",stdin);

    int n,x;

    scanf("%d",&n);int k=n-1;
    for(int i=1;i<=n;i++){
        scanf("%d",&x);
        if(x==0){lin.push_back(i);}
        else if(x>0){zhen.push_back(i);}
        else{
            fu.push_back(i);
        }
    }
    if(k<=0){return 0;}
    int siz = lin.size();
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",lin[i],lin[i+1]);
        k--;if(k<=0){return 0;}
    }

    siz = fu.size();
    if(siz>1)
    for(int i=0;i+1<siz;i+=2){
//        fuck(i)fuck(siz)
        printf("1 %d %d\n",fu[i],fu[i+1]);
        zhen.push_back(fu[i+1]); k--;if(k<=0){return 0;}
    }

    siz = zhen.size();
    if(siz>1)
    for(int i=0;i<siz-1;i++){
        printf("1 %d %d\n",zhen[i],zhen[i+1]); k--;if(k<=0){return 0;}
    }

    int a,b,c;
    a=b=c=0;
    if(fu.size()&1){a=1;}
    if(zhen.size()>0){b=1;}
    if(lin.size()>0){c=1;}

    if(a&&c){
        printf("1 %d %d\n",lin[lin.size()-1],fu[fu.size()-1]);k--;
        if(k==1){printf("2 %d\n",fu[fu.size()-1]);}
    }
    else if(a&&k==1){
        printf("2 %d\n",fu[fu.size()-1]);
    }
    else if(c&&k==1){
        printf("2 %d\n",lin[lin.size()-1]);
    }
    return 0;
}


#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
long long qwq[200005];
struct pot{
    long long aa;
    int id;
}P[200005];
bool cmp(struct pot aaa,struct pot bbb){
    return aaa.aa<bbb.aa;
}
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        scanf("%lld",&qwq[i]);
    }
    int pos=-1;
    int tot=0;
    int ms=-1;
    for(int i=0;i<n;i++){
        if(qwq[i]>0){
            if(pos==-1){
                pos=i;
            }
            else{
              printf("1 %d %d\n",i+1,pos+1);
            }
            //printf("")
        }
        else if(qwq[i]==0){
            printf("2 %d\n",i+1);
        }
        else{
            P[tot].aa=qwq[i];
            P[tot++].id=i;
        }
    }
    sort(P,P+tot,cmp);
   // cout <<pos<<endl;
    if(tot&1){
        if(pos!=-1){
        for(int i=0;i<tot-1;i++){
            printf("1 %d %d\n",P[i].id+1,pos+1);
        }
        }
        else{
        for(int i=1;i<tot-1;i++){
            printf("1 %d %d\n",P[i].id+1,P[0].id+1);
        }
        }
        printf("2 %d\n",P[tot-1].id+1);
    }
    else{
        if(pos!=-1){
        for(int i=0;i<tot;i++){
            printf("1 %d %d\n",P[i].id+1,pos+1);
        }
        }
        else{
        for(int i=1;i<tot;i++){
            printf("1 %d %d\n",P[i].id+1,P[0].id+1);
        }
        }
    }
    return 0;
}


#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
long long qwq[200005];
int ss[200005];
struct pot{
    long long aa;
    int id;
}P[200005];
bool cmp(struct pot aaa,struct pot bbb){
    return aaa.aa<bbb.aa;
}
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        scanf("%lld",&qwq[i]);
    }
    int pos=-1;
    int tot=0;
    int rng=0;
    int ms=-1;
    for(int i=0;i<n;i++){
        if(qwq[i]>0){
            if(pos==-1){
                pos=i;
            }
            else{
              printf("1 %d %d\n",i+1,pos+1);
            }
            //printf("")
        }
        else if(qwq[i]==0){
            ss[rng++]=i;
            //printf("2 %d\n",i+1);
        }
        else{
            P[tot].aa=qwq[i];
            P[tot++].id=i;
        }
    }
    sort(P,P+tot,cmp);
    if(tot&1){
        if(pos!=-1){
        for(int i=0;i<tot-1;i++){
            printf("1 %d %d\n",P[i].id+1,pos+1);
        }
        }
        else{
        for(int i=1;i<tot-1;i++){
            printf("1 %d %d\n",P[i].id+1,P[0].id+1);
        }
        }
        ss[rng++]=P[tot-1].id;
        //printf("2 %d\n",P[tot-1].id+1);
    }
    else{
        if(pos!=-1){
        for(int i=0;i<tot;i++){
            printf("1 %d %d\n",P[i].id+1,pos+1);
        }
        }
        else{
        for(int i=1;i<tot;i++){
            printf("1 %d %d\n",P[i].id+1,P[0].id+1);
        }
        }
    }
    while(rng>1){
        printf("1 %d %d\n",ss[rng-1]+1,ss[0]+1);
        rng--;
    }
    if(rng)printf("2 %d\n",ss[0]+1);
    return 0;
}


#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
long long qwq[200005];
int ss[200005];
struct pot{
    long long aa;
    int id;
}P[200005];
bool cmp(struct pot aaa,struct pot bbb){
    return aaa.aa<bbb.aa;
}
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        scanf("%lld",&qwq[i]);
    }
    int pos=-1;
    int tot=0;
    int rng=0;
    int ms=-1;
    for(int i=0;i<n;i++){
        if(qwq[i]>0){
            if(pos==-1){
                pos=i;
            }
            else{
              printf("1 %d %d\n",i+1,pos+1);
            }
            //printf("")
        }
        else if(qwq[i]==0){
            ss[rng++]=i;
            //printf("2 %d\n",i+1);
        }
        else{
            P[tot].aa=qwq[i];
            P[tot++].id=i;
        }
    }
    sort(P,P+tot,cmp);
    int ans=0;
    if(tot&1){
        if(pos!=-1){
        for(int i=0;i<tot-1;i++){
            printf("1 %d %d\n",P[i].id+1,pos+1);
            ans++;
        }
        }
        else{
        for(int i=1;i<tot-1;i++){
            printf("1 %d %d\n",P[i].id+1,P[0].id+1);
            ans++;
        }
        }
        ss[rng++]=P[tot-1].id;
        //printf("2 %d\n",P[tot-1].id+1);
    }
    else{
        if(pos!=-1){
        for(int i=0;i<tot;i++){
            printf("1 %d %d\n",P[i].id+1,pos+1);
            ans++;
        }
        }
        else{
        for(int i=1;i<tot;i++){
            printf("1 %d %d\n",P[i].id+1,P[0].id+1);
            ans++;
        }
        }
    }
    while(rng>1){
        printf("1 %d %d\n",ss[rng-1]+1,ss[0]+1);
        rng--;
        ans++;
    }
    if(rng&&ans!=n-1)printf("2 %d\n",ss[0]+1);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
using namespace std;
char ch[2005][2005];
struct pot{
    int xx;int yy;
    int ll;int rr;
    bool operator<(const struct pot &aaa)const{
        return ll+rr>aaa.ll+aaa.rr;
    }
};
int ans=1;int r,c,x,y;int n,m;
int dx[4]={-1,1,0,0};
int dy[4]={0,0,-1,1};
bool vis[2005][2005];
void bfs(){
    queue<struct pot>pq;
    struct pot aa;
    aa.xx=r-1;
    aa.yy=c-1;
    aa.ll=0;
    aa.rr=0;
    pq.push(aa);
    vis[aa.xx][aa.yy]=1;
    while(!pq.empty()){
        struct pot bb=pq.front();pq.pop();
        for(int i=0;i<4;i++){
            int tx=bb.xx+dx[i];
            int ty=bb.yy+dy[i];
            if(tx>=0&&ty>=0&&tx<n&&!vis[tx][ty]&&ty<m&&ch[tx][ty]=='.'){
                if(i==3&&bb.rr==y)continue;
                if(i==2&&bb.ll==x)continue;
                vis[tx][ty]=1;
                struct pot cc;
                cc.ll=bb.ll;cc.rr=bb.rr;
                if(i==3)
                    cc.rr=bb.rr+1;
                if(i==2)
                    cc.ll=bb.ll+1;
                cc.xx=tx;
                cc.yy=ty;
                //cout << cc.xx<<cc.yy<<cc.rr<<bb.xx<<bb.yy<<bb.rr<<i<<endl;
                ans++;
                pq.push(cc);
            }
        }
    }
}
int main(){
    scanf("%d%d",&n,&m);
    scanf("%d%d%d%d",&r,&c,&x,&y);
    for(int i=0;i<n;i++){
        scanf("%s",ch[i]);
    }

    bfs();
    cout << ans<<endl;
    return 0;
}


import sys
n = int(input())
arr = str(input()).split()
arr2 = [[0]*2 for i in range(n)]
#arr = [int(i) for i in arr]
j=0
f=0
maxNeg=-10e9
maxNegInd=-1
t1=[]
indz=[]
indo=[]
arr3=[]
for p in arr:
    i=int(p)
    arr2[j][0]=i
    if(i==0):
        indz.append(j)
    elif(i<0):
        indo.append(j)
    # else:
    #     arr3.append([])
    if(i<0 and i>maxNeg):
        maxNeg=i
        maxNegInd=j
    j+=1

for i in range(len(indz)-1):
    arr2[indz[i]][1]=1
    t1.append([indz[i],indz[i+1]])
#print(len(indo))
if(len(indz)==len(arr)):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    #sys.exit(0)
elif((len(indz)+len(indo))==len(arr) and len(indo)==1):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    print(str(2)+" "+str(maxNegInd+1))
    #sys.exit(0)
else:
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    if(len(indo)%2==0):
        if(indz):
            print("2 "+str(indz[len(indz)-1]+1))
            arr2[indz[len(indz)-1]][1]=1
    else:
        if(indz):
            arr2[indz[len(indz)-1]][1]=1
            #temp
            print(str(1)+" "+str(indz[len(indz)-1]+1)+" "+str(maxNegInd+1))
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
        else:
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
    t2=[]
    # if(len(indo)>1 and len(indo)%2==1):
    #     if(indz):
    #         #temp = len(indz)
    #         arr2[indz[len(indz)-1]][1]=1
    #         #temp
    #         print(str(1)+" "+str(indz[len(indz)])+" "+str(maxNegInd+1))
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    #     else:
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    j=0
    t3=[]
    t4=0
    for item in arr2:
        if(item[1]==0):
            t4+=1
            t2.append(j)
        if(t4>=2 and item[1]==0):
            print("1 "+str(t2[t4-2]+1)+" "+str(t2[t4-1]+1))
        j+=1
    #print(t2)
    # if(len(t2)>=2):
    #     for x in range(1,len(t2)):
    #         print("1 "+str(t2[x-1]+1)+" "+str(t2[x]+1))

    #print(arr2)


import sys
n = int(input())

arr = list(map(int, input().split()))
#arr = str(input()).split()
arr2 = [[0]*2 for i in range(n)]
#arr = [int(i) for i in arr]
j=0
f=0
maxNeg=-10e9
maxNegInd=-1
t1=[]
indz=[]
indo=[]
arr3=[]
for i in arr:
    arr2[j][0]=i
    if(i==0):
        indz.append(j)
    elif(i<0):
        indo.append(j)
    # else:
    #     arr3.append([])
    if(i<0 and i>maxNeg):
        maxNeg=i
        maxNegInd=j
    j+=1

for i in range(len(indz)-1):
    arr2[indz[i]][1]=1
    t1.append([indz[i],indz[i+1]])
#print(len(indo))
if(len(indz)==len(arr)):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    #sys.exit(0)
elif((len(indz)+len(indo))==len(arr) and len(indo)==1):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    print(str(2)+" "+str(maxNegInd+1))
    #sys.exit(0)
else:
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    if(len(indo)%2==0):
        if(indz):
            print("2 "+str(indz[len(indz)-1]+1))
            arr2[indz[len(indz)-1]][1]=1
    else:
        if(indz):
            arr2[indz[len(indz)-1]][1]=1
            #temp
            print(str(1)+" "+str(indz[len(indz)-1]+1)+" "+str(maxNegInd+1))
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
        else:
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
    t2=[]
    # if(len(indo)>1 and len(indo)%2==1):
    #     if(indz):
    #         #temp = len(indz)
    #         arr2[indz[len(indz)-1]][1]=1
    #         #temp
    #         print(str(1)+" "+str(indz[len(indz)])+" "+str(maxNegInd+1))
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    #     else:
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    j=0
    t3=[]
    t4=0
    for item in arr2:
        if(item[1]==0):
            t4+=1
            t2.append(j)
        if(t4>=2 and item[1]==0):
            print("1 "+str(t2[t4-2]+1)+" "+str(t2[t4-1]+1))
        j+=1
    #print(t2)
    # if(len(t2)>=2):
    #     for x in range(1,len(t2)):
    #         print("1 "+str(t2[x-1]+1)+" "+str(t2[x]+1))

    #print(arr2)


import sys
n = int(input())

arr = list(map(int, input().split()))
#arr = str(input()).split()
arr2 = [[0]*2 for i in range(n)]
#arr = [int(i) for i in arr]
j=0
f=0
maxNeg=-10e9
maxNegInd=-1
t1=[]
indz=[]
indo=[]
arr3=[]
for i in arr:
    arr2[j][0]=i
    if(i==0):
        indz.append(j)
    elif(i<0):
        indo.append(j)
    else:
        arr3.append(j)
    if(i<0 and i>maxNeg):
        maxNeg=i
        maxNegInd=j
    j+=1
if(len(indo)>1):
    if(len(indo)%2==1):
        for it in indo:
            if(it!=maxNeg):
                arr3.append(it)
    else:
        for it in indo:
            arr3.append(it)

for i in range(len(indz)-1):
    arr2[indz[i]][1]=1
    t1.append([indz[i],indz[i+1]])
#print(len(indo))
if(len(indz)==len(arr)):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    #sys.exit(0)
elif((len(indz)+len(indo))==len(arr) and len(indo)==1):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    print(str(2)+" "+str(maxNegInd+1))
    #sys.exit(0)
else:
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    if(len(indo)%2==0):
        if(indz):
            print("2 "+str(indz[len(indz)-1]+1))
            arr2[indz[len(indz)-1]][1]=1
    else:
        if(indz):
            arr2[indz[len(indz)-1]][1]=1
            #temp
            print(str(1)+" "+str(indz[len(indz)-1]+1)+" "+str(maxNegInd+1))
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
        else:
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
    t2=[]
    # if(len(indo)>1 and len(indo)%2==1):
    #     if(indz):
    #         #temp = len(indz)
    #         arr2[indz[len(indz)-1]][1]=1
    #         #temp
    #         print(str(1)+" "+str(indz[len(indz)])+" "+str(maxNegInd+1))
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    #     else:
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    j=0
    t3=[]
    t4=0
    #print(arr3)
    for item in arr3:

        t4+=1
        t2.append(item)
        if(t4>=2):
            print("1 "+str(t2[t4-2]+1)+" "+str(t2[t4-1]+1))

    # for item in arr2:
    #     if(item[1]==0):
    #         t4+=1
    #         t2.append(j)
    #     if(t4>=2 and item[1]==0):
    #         print("1 "+str(t2[t4-2]+1)+" "+str(t2[t4-1]+1))
    #     j+=1
    #print(t2)
    # if(len(t2)>=2):
    #     for x in range(1,len(t2)):
    #         print("1 "+str(t2[x-1]+1)+" "+str(t2[x]+1))

    #print(arr2)


import sys
n = int(input())
arr = str(input()).split()
arr2 = [[0]*2 for i in range(n)]
arr = [int(i) for i in arr]
j=0
f=0
maxNeg=-10e9
maxNegInd=-1
t1=[]
indz=[]
indo=[]
arr3=[]
for i in arr:
    arr2[j][0]=i
    if(i==0):
        indz.append(j)
    elif(i<0):
        indo.append(j)
    # else:
    #     arr3.append([])
    if(i<0 and i>maxNeg):
        maxNeg=i
        maxNegInd=j
    j+=1

for i in range(len(indz)-1):
    arr2[indz[i]][1]=1
    t1.append([indz[i],indz[i+1]])
#print(len(indo))
if(len(indz)==len(arr)):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    #sys.exit(0)
elif((len(indz)+len(indo))==len(arr) and len(indo)==1):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    print(str(2)+" "+str(maxNegInd+1))
    #sys.exit(0)
else:
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    if(len(indo)%2==0):
        if(indz):
            print("2 "+str(indz[len(indz)-1]+1))
            arr2[indz[len(indz)-1]][1]=1
    else:
        if(indz):
            arr2[indz[len(indz)-1]][1]=1
            #temp
            print(str(1)+" "+str(indz[len(indz)-1]+1)+" "+str(maxNegInd+1))
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
        else:
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
    t2=[]
    # if(len(indo)>1 and len(indo)%2==1):
    #     if(indz):
    #         #temp = len(indz)
    #         arr2[indz[len(indz)-1]][1]=1
    #         #temp
    #         print(str(1)+" "+str(indz[len(indz)])+" "+str(maxNegInd+1))
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    #     else:
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    j=0
    t3=[]
    t4=0
    for item in arr2:
        if(item[1]==0):
            t4+=1
            t2.append(j)
        if(t4>=2 and item[1]==0):
            print("1 "+str(t2[t4-2]+1)+" "+str(t2[t4-1]+1))
        j+=1
    #print(t2)
    # if(len(t2)>=2):
    #     for x in range(1,len(t2)):
    #         print("1 "+str(t2[x-1]+1)+" "+str(t2[x]+1))

    #print(arr2)


import sys
n = int(input())

arr = list(map(int, input().split()))
#arr = str(input()).split()
arr2 = [[0]*2 for i in range(n)]
#arr = [int(i) for i in arr]
j=0
f=0
maxNeg=-10e9
maxNegInd=-1
t1=[]
indz=[]
indo=[]
arr3=[]
for i in arr:
    arr2[j][0]=i
    if(i==0):
        indz.append(j)
    elif(i<0):
        indo.append(j)
    else:
        arr3.append(j)
    if(i<0 and i>maxNeg):
        maxNeg=i
        maxNegInd=j
    j+=1
if(len(indo)>1):
    if(len(indo)%2==1):
        for it in indo:
            if(it!=maxNegInd):
                arr3.append(it)
    else:
        for it in indo:
            arr3.append(it)

for i in range(len(indz)-1):
    arr2[indz[i]][1]=1
    t1.append([indz[i],indz[i+1]])
#print(len(indo))
if(len(indz)==len(arr)):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    #sys.exit(0)
elif((len(indz)+len(indo))==len(arr) and len(indo)==1):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    print(str(2)+" "+str(maxNegInd+1))
    #sys.exit(0)
else:
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    if(len(indo)%2==0):
        if(indz):
            print("2 "+str(indz[len(indz)-1]+1))
            arr2[indz[len(indz)-1]][1]=1
    else:
        if(indz):
            arr2[indz[len(indz)-1]][1]=1
            #temp
            print(str(1)+" "+str(indz[len(indz)-1]+1)+" "+str(maxNegInd+1))
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
        else:
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
    t2=[]
    # if(len(indo)>1 and len(indo)%2==1):
    #     if(indz):
    #         #temp = len(indz)
    #         arr2[indz[len(indz)-1]][1]=1
    #         #temp
    #         print(str(1)+" "+str(indz[len(indz)])+" "+str(maxNegInd+1))
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    #     else:
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    j=0
    t3=[]
    t4=0
    #print(arr3)
    #sorted(arr3)
    for item in arr3:

        t4+=1
        t2.append(item)
        if(t4>=2):
            print("1 "+str(t2[t4-2]+1)+" "+str(t2[t4-1]+1))

    # for item in arr2:
    #     if(item[1]==0):
    #         t4+=1
    #         t2.append(j)
    #     if(t4>=2 and item[1]==0):
    #         print("1 "+str(t2[t4-2]+1)+" "+str(t2[t4-1]+1))
    #     j+=1
    #print(t2)
    # if(len(t2)>=2):
    #     for x in range(1,len(t2)):
    #         print("1 "+str(t2[x-1]+1)+" "+str(t2[x]+1))

    #print(arr2)


import sys
n = int(input())
arr = str(input()).split()
arr2 = [[0]*2 for i in range(n)]
arr = [int(i) for i in arr]
j=0
f=0
maxNeg=-10e9
maxNegInd=-1
t1=[]
indz=[]
indo=[]
for i in arr:
    arr2[j][0]=i
    if(i==0):
        indz.append(j)
    if(i<0):
        indo.append(j)
    if(i<0 and i>maxNeg):
        maxNeg=i
        maxNegInd=j
    j+=1

for i in range(len(indz)-1):
    arr2[indz[i]][1]=1
    t1.append([indz[i],indz[i+1]])
#print(len(indo))
if(len(indz)==len(arr)):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    #sys.exit(0)
elif((len(indz)+len(indo))==len(arr) and len(indo)==1):
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    print(str(2)+" "+str(maxNegInd+1))
    #sys.exit(0)
else:
    if(t1):
        for items in t1:
            print("1 "+str(items[0]+1)+" "+str(items[1]+1))
    if(len(indo)%2==0):
        if(indz):
            print("2 "+str(indz[len(indz)-1]+1))
            arr2[indz[len(indz)-1]][1]=1
    else:
        if(indz):
            arr2[indz[len(indz)-1]][1]=1
            #temp
            print(str(1)+" "+str(indz[len(indz)-1]+1)+" "+str(maxNegInd+1))
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
        else:
            arr2[maxNegInd][1]=1
            print(str(2)+" "+str(maxNegInd+1))
    t2=[]
    # if(len(indo)>1 and len(indo)%2==1):
    #     if(indz):
    #         #temp = len(indz)
    #         arr2[indz[len(indz)-1]][1]=1
    #         #temp
    #         print(str(1)+" "+str(indz[len(indz)])+" "+str(maxNegInd+1))
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    #     else:
    #         arr[maxNegInd][1]=1
    #         print(str(2)+" "+str(maxNegInd+1))
    j=0
    t3=[]
    for item in arr2:
        if(item[1]==0):
            t2.append(j)
        j+=1
    if(len(t2)>=2):
        for x in range(1,len(t2)):
            print("1 "+str(t2[x-1]+1)+" "+str(t2[x]+1))

    #print(arr2)


from queue import PriorityQueue as PQ

n = int(input())
vector = [int(i) for i in input().split()]
negativo = PQ()
countneg = 0
positivo = PQ()
countpos = 0
zeros = []
i = 0
while i < n:
    v = vector[i]
    if v < 0:
        countneg+=1
        negativo.put((v,i+1))
    elif v > 0:
        countpos += 1
        positivo.put((-v,i+1))
    else:
        zeros.append(i+1)
    i+=1

if countneg == 0 and countpos == 0:
    while zeros[1:] != []:
        print(1,zeros[0],zeros[1])
        zeros = zeros[1:]
elif countneg == 1 and countpos == 0 and zeros != []:
    x = negativo.get()
    print(1,x[1],zeros[0])
    while zeros[1:] != []:
        print(1,zeros[0],zeros[1])
        zeros = zeros[1:]
elif zeros != []:
    countneg -= countneg%2
    while countneg != 0:
        x1,i1 = negativo.get()
        x2,i2 = negativo.get()
        print(1,i1,i2)
        positivo.put((-(x1*x2),i2))
        countneg -= 2
    if not negativo.empty():
        x,i = negativo.get()
        print(1,i,zeros[0])
    while zeros[1:] != []:
        print(1,zeros[0],zeros[1])
        zeros = zeros[1:]
    print(2,zeros[0])
    while not positivo.empty():
        x1,i1 = positivo.get()
        if not positivo.empty():
            x2,i2 = positivo.get()
        else:
            break
        print(1,i1,i2)
        positivo.put((-(x1*x2),i2))
elif zeros == []:
    countneg -= countneg%2
    while countneg != 0:
        x1,i1 = negativo.get()
        x2,i2 = negativo.get()
        print(1,i1,i2)
        positivo.put((-(x1*x2),i2))
        coutneg -= 2
    if not negativo.empty():
        x,i = negativo.get()
        print(2,i)
    while not positivo.empty():
        x1,i1 = positivo.get()
        if not positivo.empty():
            x2,i2 = positivo.get()
        else:
            break
        print(1,i1,i2)
        positivo.put((-(x1*x2),i2))


n = int(input())
vector = [int(i) for i in input().split()]
usado = []
nusado = []
pos = -1
cn = 0
cz = 0
resp = []
i = 0
while i < n:
    v = vector[i]
    if v < 0:
        cn+=1
        if pos == -1 or (vector[pos] < v):
            pos = i
        nusado.append(i)
    elif v == 0:
        cz+=1
        usado.append(i)
    else:
        nusado.append(i)
    i+=1

if cz == n or (cz == n - 1 and cn == 1):
    i = 1
    while i < n:
        resp.append("%d %d %d" % (1,i,i+1))
        i+=1
else:
    cross = -1
    if cn%2 == 1:
        cross = pos
        usado.append(pos)
    ultimo = -1
    i = 0
    for i in usado:
        if ultimo != -1:
            resp.append("%d %d %d" % (1,ultimo+1,i+1))
        ultimo = i
        i+=1
    if ultimo != -1:
        resp.append("%d %d" % (2,ultimo+1))
    i = 0
    ultimo = -1
    for i in nusado:
        if i != cross:
            if ultimo != -1:
                resp.append("%d %d %d" % (1,ultimo+1,i+1))
            ultimo = i
        i+=1
print("\n".join(resp))


from queue import PriorityQueue as PQ

n = int(input())
vector = [int(i) for i in input().split()]
usado = [False]*n
pos = -1
cn = 0
cz = 0

i = 0
while i < n:
    v = vector[i]
    if v < 0:
        cn+=1
        if pos == -1 or (vector[pos] < v):
            pos = i
    elif v == 0:
        cz+=1
        usado[i] = True
    i+=1

if cz == n or (cz == n - 1 and cn == 1):
    i = 1
    while i < n:
        print(1,i,i+1)
        i+=1
else:
    if cn%2 == 1:
        usado[pos] = True
    ultimo = -1
    i = 0
    while i < n:
        if ultimo != -1 and usado[i]:
            print(i,ultimo+1,i+1)
            ultimo = i
        elif usado[i]:
            ultimo = i
        i+=1
    if ultimo != -1:
        print(2,ultimo+1)
    i = 0
    ultimo = -1
    while i < n:
        if not usado[i]:
            if ultimo != -1:
                print(1,ultimo+1,i+1)
                ultimo = i
            else:
                ultimo = i
        i+=1


from queue import PriorityQueue as PQ

n = int(input())
vector = [int(i) for i in input().split()]
usado = [False]*n
pos = -1
cn = 0
cz = 0

i = 0
while i < n:
    v = vector[i]
    if v < 0:
        cn+=1
        if pos == -1 or (vector[pos] < v):
            pos = i
    elif v == 0:
        cz+=1
        usado[i] = True
    i+=1

if cz == n or (cz == n - 1 and cn == 1):
    i = 1
    while i < n:
        print(1,i,i+1)
        i+=1
else:
    if cn%2 == 1:
        usado[pos] = True
    ultimo = -1
    i = 0
    while i < n:
        if ultimo != -1 and usado[i]:
            print(1,ultimo+1,i+1)
            ultimo = i
        elif usado[i]:
            ultimo = i
        i+=1
    if ultimo != -1:
        print(2,ultimo+1)
    i = 0
    ultimo = -1
    while i < n:
        if not usado[i]:
            if ultimo != -1:
                print(1,ultimo+1,i+1)
                ultimo = i
            else:
                ultimo = i
        i+=1


n = int(input())
vector = [int(i) for i in input().split()]
usado = []
nusado = []
pos = -1
cn = 0
cz = 0
resp = []
ultimo = -1
i = 0
while i < n:
    v = vector[i]
    if v < 0:
        cn+=1
        if pos == -1 or (vector[pos] < v):
            pos = i
        nusado.append(i)
    elif v == 0:
        cz+=1
        usado.append(i)
    else:
        if ultimo != -1:
            print(1,ultimo+1,i+1)
        ultimo = i
    i+=1
ultimate = ultimo

if cz == n or (cz == n - 1 and cn == 1):
    i = 1
    while i < n:
        resp.append("%d %d %d" %(1,i,i+1))
        i+=1
else:
    cross = -1
    if cn%2 == 1:
        cross = pos
        usado.append(pos)
    ultimo = -1
    i = 0
    for i in usado:
        if ultimo != -1:
            resp.append("%d %d %d" % (1,ultimo+1,i+1))
        ultimo = i
        i+=1
    if ultimo != -1:
        print(2,ultimo+1)
    i = 0
    ultimo = ultimate
    for i in nusado:
        if i != cross:
            if ultimo != -1:
                resp.append("%d %d %d" % (1,ultimo+1,i+1))
            ultimo = i
        i+=1
print("\n".join(resp))


from queue import PriorityQueue as PQ

n = int(input())
vector = [int(i) for i in input().split()]
usado = []
nusado = []
pos = -1
cn = 0
cz = 0

i = 0
while i < n:
    v = vector[i]
    if v < 0:
        cn+=1
        if pos == -1 or (vector[pos] < v):
            pos = i
        nusado.append(i)
    elif v == 0:
        cz+=1
        usado.append(i)
    else:
        nusado.append(i)
    i+=1

if cz == n or (cz == n - 1 and cn == 1):
    i = 1
    while i < n:
        print(1,i,i+1)
        i+=1
else:
    cross = -1
    if cn%2 == 1:
        cross = pos
        usado.append(pos)
    ultimo = -1
    i = 0
    for i in usado:
        if ultimo != -1:
            print(1,ultimo+1,i+1)
        ultimo = i
        i+=1
    if ultimo != -1:
        print(2,ultimo+1)
    i = 0
    ultimo = -1
    for i in nusado:
        if i != cross:
            if ultimo != -1:
                print(1,ultimo+1,i+1)
            ultimo = i
        i+=1


from queue import PriorityQueue as PQ

n = int(input())
vector = [int(i) for i in input().split()]
negativo = PQ()
countneg = 0
positivo = PQ()
countpos = 0
zeros = []
i = 0
while i < n:
    v = vector[i]
    if v < 0:
        countneg+=1
        negativo.put((v,i+1))
    elif v > 0:
        countpos += 1
        positivo.put((-v,i+1))
    else:
        zeros.append(i+1)
    i+=1

if countneg == 0 and countpos == 0:
    while zeros[1:] != []:
        print(1,zeros[0],zeros[1])
        zeros = zeros[1:]
elif countneg == 1 and countpos == 0 and zeros != []:
    x = negativo.get()
    print(1,x[1],zeros[0])
    while zeros[1:] != []:
        print(1,zeros[0],zeros[1])
        zeros = zeros[1:]
elif zeros != []:
    countneg -= countneg%2
    while countneg != 0:
        x1,i1 = negativo.get()
        x2,i2 = negativo.get()
        print(1,i1,i2)
        positivo.put((-(x1*x2),i2))
        countneg -= 2
    if not negativo.empty():
        x,i = negativo.get()
        print(1,i,zeros[0])
    while zeros[1:] != []:
        print(1,zeros[0],zeros[1])
        zeros = zeros[1:]
    print(2,zeros[0])
    while not positivo.empty():
        x1,i1 = positivo.get()
        if not positivo.empty():
            x2,i2 = positivo.get()
        else:
            break
        print(1,i1,i2)
        positivo.put((-(x1*x2),i2))
elif zeros == []:
    countneg -= countneg%2
    while countneg != 0:
        x1,i1 = negativo.get()
        x2,i2 = negativo.get()
        print(1,i1,i2)
        positivo.put((-(x1*x2),i2))
        coutneg -= 2
    if not negativo.empty():
        x,i = negativo.get()
        print(2,i)
    while zeros[1:] != []:
        print(1,zeros[0],zeros[1])
        zeros = zeros[1:]
    print(2,zeros[0])
    while not positivo.empty():
        x1,i1 = positivo.get()
        if not positivo.empty():
            x2,i2 = positivo.get()
        else:
            break
        print(1,i1,i2)
        positivo.put((-(x1*x2),i2))


r = input
n = int(r())
a = []
zero = []
nega = []
normal = []
MaxNega = -10**9
IdMaxNega = -1
cnt = 0
res =str("")
def Printall(arr):
    Str=str("")
    for i in range(1,len(arr)):
        Str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return Str
for i in r().split():
    t = int(i)
    a.append(t)
    if(t < 0 and MaxNega < t):
        MaxNega = t
        IdMaxNega = cnt
    if(t == 0):
        zero.append(cnt)
    if(t > 0):
        normal.append(cnt)
    if(t < 0):
        nega.append(cnt)
    cnt+=1
Nzero = len(zero)
Nnega = len(nega)
if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


r = input
n = int(r())
a = [int(x) for x in r().split()]
zero = []
nega = []
normal = []
MaxNega = int(-10**12+7)
IdMaxNega = -1
cnt = int(0)
res =str("")
def Printall(arr):
    Str=str("")
    for i in range(1,len(arr)):
        Str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return Str
for i in a:
    if(i < 0 and MaxNega < i):
        MaxNega = i
        IdMaxNega = cnt
    if(i == 0):
        zero.append(cnt)
    if(i > 0):
        normal.append(cnt)
    if(i < 0):
        nega.append(cnt)
    cnt+=1
a = []
Nzero = len(zero)
Nnega = len(nega)
if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


r = input
n = int(r())
a = [int(x) for x in r().split()]
zero = []
nega = []
normal = []
MaxNega = int(-10**9-7)
IdMaxNega = -1
cnt = int(0)
res =str("")
def Printall(arr):
    Str=str("")
    for i in range(1,len(arr)):
        Str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return Str
for i in a:
    if(i < 0 and MaxNega < i):
        MaxNega = i
        IdMaxNega = cnt
    if(i == 0):
        zero.append(cnt)
    if(i > 0):
        normal.append(cnt)
    if(i < 0):
        nega.append(cnt)
    cnt+=1
a = []
Nzero = len(zero)
Nnega = len(nega)

if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal) == 0 and len(nega) == 1):
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


r = input
n = int(r())
a = [int(x) for x in r().split()]
zero = []
nega = []
normal = []
MaxNega = int(-10**9-7)
IdMaxNega = -1
cnt = int(0)
res =str("")
def Printall(arr):
    Str=str("")
    for i in range(1,len(arr)):
        Str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return Str
for i in a:
    if(i < 0 and MaxNega < i):
        MaxNega = i
        IdMaxNega = cnt
    if(i == 0):
        zero.append(cnt)
    if(i > 0):
        normal.append(cnt)
    if(i < 0):
        nega.append(cnt)
    cnt+=1
a = []
Nzero = len(zero)
Nnega = len(nega)
if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


r = input
n = int(r())
a = [int(x) for x in r().split()]
zero = []
nega = []
normal = []
MaxNega = int(-10**9+7)
IdMaxNega = -1
cnt = 0
res =str("")
def Printall(arr):
    Str=str("")
    for i in range(1,len(arr)):
        Str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return Str
for i in a:
    if(i < 0 and MaxNega < i):
        MaxNega = i
        IdMaxNega = cnt
    if(i == 0):
        zero.append(cnt)
    if(i > 0):
        normal.append(cnt)
    if(i < 0):
        nega.append(cnt)
    cnt+=1
Nzero = len(zero)
Nnega = len(nega)
if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


r = input
n = int(r())
a = [int(x) for x in r().split()]
zero = []
nega = []
normal = []
MaxNega = int(-10**20-7)
IdMaxNega = -1
cnt = int(0)
res =str("")
def Printall(arr):
    Str=str("")
    for i in range(1,len(arr)):
        Str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return Str
for i in a:
    if(i < 0 and MaxNega < i):
        MaxNega = i
        IdMaxNega = cnt
    if(i == 0):
        zero.append(cnt)
    if(i > 0):
        normal.append(cnt)
    if(i < 0):
        nega.append(cnt)
    cnt+=1
a = []
Nzero = len(zero)
Nnega = len(nega)
if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


r = input
n = int(r())
a = []
nega = []
zero = []
Del = []
#Read t
cnt = 0
ans =""
for x in r().split():
    t = int(x)
    Del.append(bool(1))
    if(t < 0):
        nega.append(cnt)
    if(t == 0):
        zero.append(cnt)
    cnt+=1
#Global
len_zero = len(zero)
len_nega = len(nega)
#Remove 0
delZero = -1
if(len_zero>0):
    delZero = zero[0]+1
for i in range(1,len_zero):
    Del[zero[i-1]] = 0
    ans += "1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    delZero = zero[i]+1
#Remove < 0
delNega = -1
if(len_nega>0):
    delNega = nega[0]+1
for i in range(1,len_nega):
        Del[nega[i-1]] = 0
        ans += "1 %d %d\n"%(nega[i-1]+1,nega[i]+1)
        delNega = nega[i]+1

# Mot so - nhan mot so 0
go = 0
if(len_nega&1 == 1 and delZero !=-1):
    ans += "1 %d %d\n"%(delZero,delNega)
    Del[delZero-1] = 0
    delZero = delNega
    go = 1
#Con mot so am thi Xoa
if(len_nega&1 == 1 and delZero == -1):
    ans += "2 %d\n"%(delNega)
    Del[delNega-1] = 0
# - Chang thi xoa 0
less = sum(x == 1 for x in Del)
if((len_nega&1 == 0 or go == 1) and delZero != -1 and less > 1):
    Del[delZero-1] = 0
    less-=1
    ans +="2 %d\n"%(delZero)

if(less>0):
    pr = []
    for i in range(0,n):
        if(Del[i] == 1):
            pr.append(i)
    for i in range(1,len(pr)):
        ans+="1 %d %d\n"%(pr[i-1]+1,pr[i]+1)
print(ans)


r = input
n = int(r())
a = [int(x) for x in r().split()]
zero = []
nega = []
normal = []
MaxNega = int(-10**200-7)
IdMaxNega = -1
cnt = int(0)
res =str("")
def Printall(arr):
    Str=str("")
    for i in range(1,len(arr)):
        Str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return Str
for i in a:
    if(i < 0 and MaxNega < i):
        MaxNega = i
        IdMaxNega = cnt
    if(i == 0):
        zero.append(cnt)
    if(i > 0):
        normal.append(cnt)
    if(i < 0):
        nega.append(cnt)
    cnt+=1
a = []
Nzero = len(zero)
Nnega = len(nega)
if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


r = input
n = int(r())
a = []
zero = []
nega = []
normal = []
MaxNega = -10**9+3
IdMaxNega = -1
cnt = 0
res =""
def Printall(arr):
    str=""
    for i in range(1,len(arr)):
        str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return str
for i in r().split():
    t = int(i)
    a.append(t)
    if(t < 0 and MaxNega < t):
        MaxNega = t
        IdMaxNega = cnt
    if(t == 0):
        zero.append(cnt)
    if(t > 0):
        normal.append(cnt)
    if(t < 0):
        nega.append(cnt)
    cnt+=1
Nzero = len(zero)
Nnega = len(nega)
if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


r = input
n = int(r())
a = [int(x) for x in r().split()]
zero = []
nega = []
normal = []
MaxNega = int(-10**18-7)
IdMaxNega = -1
cnt = int(0)
res =str("")
def Printall(arr):
    Str=str("")
    for i in range(1,len(arr)):
        Str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return Str
for i in a:
    if(i < 0 and MaxNega < i):
        MaxNega = i
        IdMaxNega = cnt
    if(i == 0):
        zero.append(cnt)
    if(i > 0):
        normal.append(cnt)
    if(i < 0):
        nega.append(cnt)
    cnt+=1
a = []
Nzero = len(zero)
Nnega = len(nega)
if(Nnega == 0 and Nzero == 0):
    res += Printall(normal)
elif(Nzero == 0):
    if(Nnega&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(Nnega>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(Nzero>0):
    for i in range(1,Nzero):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(Nnega == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(Nnega>0):
        if(Nnega&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(Nnega>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            normal = normal+nega
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)