Problem: You are given an array a consisting of n integers. You can perform the following operations with it: 

  1. Choose some positions i and j (1 ≤ i, j ≤ n, i ≠ j), write the value of a_i ⋅ a_j into the j-th cell and remove the number from the i-th cell; 
  2. Choose some position i and remove the number from the i-th cell (this operation can be performed no more than once and at any point of time, not necessarily in the beginning). 



The number of elements decreases by one after each operation. However, the indexing of positions stays the same. Deleted numbers can't be used in the later operations.

Your task is to perform exactly n - 1 operations with the array in such a way that the only number that remains in the array is maximum possible. This number can be rather large, so instead of printing it you need to print any sequence of operations which leads to this maximum number. Read the output format to understand what exactly you need to print.

Input

The first line contains a single integer n (2 ≤ n ≤ 2 ⋅ 10^5) — the number of elements in the array.

The second line contains n integers a_1, a_2, ..., a_n (-10^9 ≤ a_i ≤ 10^9) — the elements of the array.

Output

Print n - 1 lines. The k-th line should contain one of the two possible operations.

The operation of the first type should look like this: 1~ i_k~ j_k, where 1 is the type of operation, i_k and j_k are the positions of the chosen elements.

The operation of the second type should look like this: 2~ i_k, where 2 is the type of operation, i_k is the position of the chosen element. Note that there should be no more than one such operation.

If there are multiple possible sequences of operations leading to the maximum number — print any of them.

Examples

Input

5
5 -2 0 1 -3


Output

2 3
1 1 2
1 2 4
1 4 5


Input

5
5 2 0 4 0


Output

1 3 5
2 5
1 1 2
1 2 4


Input

2
2 -1


Output

2 2


Input

4
0 -10 0 0


Output

1 1 2
1 2 3
1 3 4


Input

4
0 0 0 0


Output

1 1 2
1 2 3
1 3 4

Note

Let X be the removed number in the array. Let's take a look at all the examples:

The first example has, for example, the following sequence of transformations of the array: [5, -2, 0, 1, -3] → [5, -2, X, 1, -3] → [X, -10, X, 1, -3] → [X, X, X, -10, -3] → [X, X, X, X, 30]. Thus, the maximum answer is 30. Note, that other sequences that lead to the answer 30 are also correct.

The second example has, for example, the following sequence of transformations of the array: [5, 2, 0, 4, 0] → [5, 2, X, 4, 0] → [5, 2, X, 4, X] → [X, 10, X, 4, X] → [X, X, X, 40, X]. The following answer is also allowed: 
    
    
      
    1 5 3  
    1 4 2  
    1 2 1  
    2 3  
    

Then the sequence of transformations of the array will look like this: [5, 2, 0, 4, 0] → [5, 2, 0, 4, X] → [5, 8, 0, X, X] → [40, X, 0, X, X] → [40, X, X, X, X].

The third example can have the following sequence of transformations of the array: [2, -1] → [2, X].

The fourth example can have the following sequence of transformations of the array: [0, -10, 0, 0] → [X, 0, 0, 0] → [X, X, 0, 0] → [X, X, X, 0].

The fifth example can have the following sequence of transformations of the array: [0, 0, 0, 0] → [X, 0, 0, 0] → [X, X, 0, 0] → [X, X, X, 0].

Solution (in JAVA):

Solution:
/*
 *     HI THERE!
 * 
 * CREATED BY : NAITIK V
 * 
 *     JAI HIND
 * 
 */

import java.util.*;
import java.io.*;
public class A		
{ 
			 static FastReader sc=new FastReader(); 
			 static long dp[][];
			 static int mod=1000000007;
		     public static void main(String[] args)
		    {
			  PrintWriter out=new PrintWriter(System.out);
			  StringBuffer sb=new StringBuffer("");
			 
		  int ttt=1;
		 //  ttt =i();
		    outer :while (ttt-- > 0) 
			{
		    	int n=i();
	        	long A[]=inputL(n);
	        	int z=0,p=0,ng=0;
 
	        	ArrayList<Integer> a=new ArrayList<Integer>();
	        	ArrayList<Integer> b=new ArrayList<Integer>();
	        	ArrayList<Integer> c=new ArrayList<Integer>();
	        	for(int i=0;i<n;i++) {
	        		if(A[i]==0) {
	        			z++;
	        			c.add(i+1);
	        		}
	        		else if(A[i]>0) {
	        			p++;
	        			a.add(i+1);
	        		}
	        		else {
	        			ng++;
	        			b.add(i+1);
	        		}
	        	}
	        	a.sort(null);
	        	b.sort(null);
	        	int f=1;
	        	int op=0;
	        	if(z>1) {
	        		for(int i=0;i<c.size()-1;i++) {
	        			out.println("1 "+c.get(i)+" "+c.get(i+1));
	        			op++;
	        		}
	        		if(c.size()==n) {
	        			out.flush();
	        			return;
	        		}
	        		int last=c.get(c.size()-1);
	        		c.clear();
	        		c.add(last);
	        		z=1;
	        		f=-1;
	        	}
	        	if(z==1) {
	        		if(ng%2==0) {
	        			out.println("2 "+c.get(0));
	        			for(int i=0;i<b.size()-1;i++) {
	        				out.println("1 "+b.get(i)+" "+b.get(i+1));
	        			}
	        			for(int i=0;i<a.size()-1;i++) {
	        				out.println("1 "+a.get(i)+" "+a.get(i+1));
	        			}
	        			if(b.size()>0 && a.size()>0) {
	        				out.println("1 "+a.get(a.size()-1)+" "+b.get(b.size()-1));
	        			}
	        			
	        		}
	        		else {
	        				//b.add(c.get(c.size()-1));
	        			long max=Integer.MIN_VALUE;
	        			int ind=-1;
	        			for(int i : b) {
	        				if(A[i-1]>max) {
	        					max=A[i-1];
	        					ind=i;
	        				}
	        			}
	        			for(int i=0;i<b.size();i++) {
	        				if(b.get(i)==ind) {
	        					b.remove(i);
	        					break;
	        				}
	        			}
	        			out.println("1 "+ind+" "+c.get(c.size()-1));
	        			op++;
	        			if(op==n-1) {
	        				out.flush();
	        				return;
	        			}
	        			
	        			out.println("2 "+c.get(0));
	        			op++;
	        			if(op==n-1) {
	        				out.flush();
	        				return;
	        			}
	        				for(int i=0;i<b.size()-1;i++) {
		        				out.println("1 "+b.get(i)+" "+b.get(i+1));
		        			}
		        			for(int i=0;i<a.size()-1;i++) {
		        				out.println("1 "+a.get(i)+" "+a.get(i+1));
		        			}
		        			if(b.size()>0 && a.size()>0) {
		        				out.println("1 "+a.get(a.size()-1)+" "+b.get(b.size()-1));
		        			}
	        			}
	        		
	        	}
	        	else {
	        		if(ng%2!=0) {
//	        			out.println("2 "+b.get(b.size()-1));
//	        			b.remove(b.size()-1);
	        			long max=Integer.MIN_VALUE;
	        			int ind=-1;
	        			for(int i : b) {
	        				if(A[i-1]>max) {
	        					max=A[i-1];
	        					ind=i;
	        				}
	        			}
	        			for(int i=0;i<b.size();i++) {
	        				if(b.get(i)==ind) {
	        					b.remove(i);
	        					break;
	        				}
	        			}
	        		
	        		out.println("2 "+ind);
	        		for(int i=0;i<b.size()-1;i++) {
        				out.println("1 "+b.get(i)+" "+b.get(i+1));
        			}
	        		for(int i=0;i<a.size()-1;i++) {
        				out.println("1 "+a.get(i)+" "+a.get(i+1));
        			}
        			if(b.size()>0 && a.size()>0) {
        				out.println("1 "+a.get(a.size()-1)+" "+b.get(b.size()-1));
        			}
	        		
	        	}
	        		else {
	        			for(int i=1;i<n;i++) {
	        				out.println("1 "+i+" "+(i+1));
	        			}
	        		}
	        	}
	        	
		    	
		    	
			}
		   out.close();
		  // System.out.println(sb.toString());
		   
		   
		   //CHECK FOR N=1                    //CHECK FOR M=0
		    //CHECK FOR N=1                    //CHECK FOR M=0
		   	//CHECK FOR N=1
		   	//CHECK FOR N=1
		   	//CHECK FOR N=1
    }
			  
		     
		    

			  
			 
		     
		     
  static class Pair implements Comparable<Pair>
   {
	   int x;
	   int y;
	  	 Pair(int x,int y){
	  		 this.x=x;
	  		 this.y=y;
	  	 }
	@Override
//	public int compareTo(Pair o) {
//		if(this.x>o.x)
//			return 1;
//		else if(this.x<o.x)
//			return -1;
//		else {
//			if(this.y<o.y)
//				return 1;
//			else if(this.y>o.y)
//				return -1;
//			else
//				return 0;
//		}
//	}
	
	
	public int compareTo(Pair o) {
			if (x > o.x) {
				return 1;
			}
			if (x < o.x) {
				return -1;
			}
			if (y > o.y) {
				return 1;
			}
			if (y < o.y) {
				return -1;
			}
			return 0;
		}
	
 }
static int[] input(int n) {
  	int A[]=new int[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.nextInt();
  	   }
  	   return A;
     }
  static long[] inputL(int n) {
  	long A[]=new long[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.nextLong();
  	   }
  	   return A;
     }
  static String[] inputS(int n) {
  	String A[]=new String[n];
  	   for(int i=0;i<n;i++) {
  		   A[i]=sc.next();
  	   }
  	   return A;
     }
  static long sum(int A[]) {
  	long sum=0;
  	for(int i : A) {
  		sum+=i;
  	}
  	return sum;
  }
  static long sum(long A[]) {
  	long sum=0;
  	for(long i : A) {
  		sum+=i;
  	}
  	return sum;
  }

  static void input(int A[],int B[]) {
  	   for(int i=0;i<A.length;i++) {
  		   A[i]=sc.nextInt();
  		   B[i]=sc.nextInt();
  	   }
  }
  static int[][] input(int n,int m){
  	int A[][]=new int[n][m];
  	for(int i=0;i<n;i++) {
  		for(int j=0;j<m;j++) {
  			A[i][j]=i();
  		}
  	}
  	return A;
  }
  static char[][] charinput(int n,int m){
  	char A[][]=new char[n][m];
  	for(int i=0;i<n;i++) {
  		String s=s();
  		for(int j=0;j<m;j++) {
  			A[i][j]=s.charAt(j);
  		}
  	}
  	return A;
  }
  static int max(int A[]) {
  	int max=Integer.MIN_VALUE;
  	for(int i=0;i<A.length;i++) {
  		max=Math.max(max, A[i]);
  	}
  	return max;
  }
  static int min(int A[]) {
  	int min=Integer.MAX_VALUE;
  	for(int i=0;i<A.length;i++) {
  		min=Math.min(min, A[i]);
  	}
  	return min;
  }
  static long max(long A[]) {
  	long max=Long.MIN_VALUE;
  	for(int i=0;i<A.length;i++) {
  		max=Math.max(max, A[i]);
  	}
  	return max;
  }
  static long min(long A[]) {
  	long min=Long.MAX_VALUE;
  	for(int i=0;i<A.length;i++) {
  		min=Math.min(min, A[i]);
  	}
  	return min;
  }
  static long mod(long x) {
  	 int mod=1000000007;
  	  return ((x%mod + mod)%mod);
  }
  static String reverse(String s) {
  	StringBuffer p=new StringBuffer(s);
  	p.reverse();
  	return p.toString();
  }

       static int i() {
      	 return sc.nextInt();
       }
       static String s() {
      	 return sc.next();
       }
       static long l() {
      	 return sc.nextLong();
       }  
       static void sort(int[] A){
          int n = A.length;
          Random rnd = new Random();
          for(int i=0; i<n; ++i){
              int tmp = A[i];
              int randomPos = i + rnd.nextInt(n-i);
              A[i] = A[randomPos];
              A[randomPos] = tmp;
          }
          Arrays.sort(A);
       }
       static void sort(long[] A){
  	        int n = A.length;
  	        Random rnd = new Random();
  	        for(int i=0; i<n; ++i){
  	            long tmp = A[i];
  	            int randomPos = i + rnd.nextInt(n-i);
  	            A[i] = A[randomPos];
  	            A[randomPos] = tmp;
  	        }
  	        Arrays.sort(A);
  	     }
    static String sort(String s) {
   	 Character ch[]=new Character[s.length()];
   	 for(int i=0;i<s.length();i++) {
   		 ch[i]=s.charAt(i);
   	 }
   	 Arrays.sort(ch);
   	 StringBuffer st=new StringBuffer("");
 for(int i=0;i<s.length();i++) {
	 st.append(ch[i]);
 }
 return st.toString();
}
static HashMap<Integer,Integer> hash(int A[]){
  HashMap<Integer,Integer> map=new HashMap<Integer, Integer>();
  for(int i : A) {
	  if(map.containsKey(i)) {
		  map.put(i, map.get(i)+1);
	  }
	  else {
		  map.put(i, 1);
	  }
  }
  return map;
}
static HashMap<Long,Integer> hash(long A[]){
	  HashMap<Long,Integer> map=new HashMap<Long, Integer>();
	  for(long i : A) {
		  if(map.containsKey(i)) {
			  map.put(i, map.get(i)+1);
		  }
		  else {
			  map.put(i, 1);
		  }
	  }
	  return map;
	}
static TreeMap<Integer,Integer> tree(int A[]){
  TreeMap<Integer,Integer> map=new TreeMap<Integer, Integer>();
  for(int i : A) {
	  if(map.containsKey(i)) {
		  map.put(i, map.get(i)+1);
	  }
	  else {
		  map.put(i, 1);
	  }
  }
  return map;
}
static TreeMap<Long,Integer> tree(long A[]){
	  TreeMap<Long,Integer> map=new TreeMap<Long, Integer>();
	  for(long i : A) {
		  if(map.containsKey(i)) {
			  map.put(i, map.get(i)+1);
		  }
		  else {
			  map.put(i, 1);
		  }
	  }
	  return map;
	}
static void primefact(int n) {
	  for(int i=2;i*i<=n;i++) {
		  if(n%i==0) {
			  int cnt=0;
			  while(n%i==0) {
				  cnt++;
				  n/=i;
			  }
			  System.out.println(i+"^"+cnt);
			  
		  }
	  }
	  if(n>1) {
		  System.out.println(n+"^ 1");
	  }
}
   static boolean prime(int n) 
    { 
        if (n <= 1) 
            return false; 
        if (n <= 3) 
            return true; 
        if (n % 2 == 0 || n % 3 == 0) 
            return false; 
        double sq=Math.sqrt(n);
  
        for (int i = 5; i <= sq; i = i + 6) 
            if (n % i == 0 || n % (i + 2) == 0) 
                return false; 
        return true; 
    } 
   static boolean prime(long n) 
    { 
        if (n <= 1) 
            return false; 
        if (n <= 3) 
            return true; 
        if (n % 2 == 0 || n % 3 == 0) 
            return false; 
        double sq=Math.sqrt(n);
  
        for (int i = 5; i <= sq; i = i + 6) 
            if (n % i == 0 || n % (i + 2) == 0) 
                return false; 
        return true; 
    } 
   static long power(long x, long y, long p)
   {

       long res = 1;
       x = x % p;

       while (y > 0) {

           if (y % 2 == 1)
               res = (res * x) % p;

           y = y >> 1; 
           x = (x * x) % p;
       }

       return res;
   }

   static long modInverse(long n, long p)
   {
       return power(n, p - 2, p);
   }
   static int gcd(int a, int b) 
   { 
       if (a == 0) 
           return b; 
       return gcd(b % a, a); 
   } 
   static long gcd(long a, long b) 
   { 
       if (a == 0) 
           return b; 
       return gcd(b % a, a); 
   } 
  
      
  static class FastReader 
  { 
      BufferedReader br; 
      StringTokenizer st; 

      public FastReader() 
      { 
          br = new BufferedReader(new
                   InputStreamReader(System.in)); 
      } 

      String next() 
      { 
          while (st == null || !st.hasMoreElements()) 
          { 
              try
              { 
                  st = new StringTokenizer(br.readLine()); 
              } 
              catch (IOException  e) 
              { 
                  e.printStackTrace(); 
              } 
          } 
          return st.nextToken(); 
      } 

      int nextInt() 
      { 
          return Integer.parseInt(next()); 
      } 

      long nextLong() 
      { 
          return Long.parseLong(next()); 
      } 

      double nextDouble() 
      { 
          return Double.parseDouble(next()); 
      } 

      String nextLine() 
      { 
          String str = ""; 
              try
              { 
                  str = br.readLine(); 
              } 
              catch (IOException e) 
              { 
                  e.printStackTrace(); 
              } 
              return str; 
          } 
      } 
  }