Problem: You're given an array a of length n. You can perform the following operations on it:

  * choose an index i (1 ≤ i ≤ n), an integer x (0 ≤ x ≤ 10^6), and replace a_j with a_j+x for all (1 ≤ j ≤ i), which means add x to all the elements in the prefix ending at i. 
  * choose an index i (1 ≤ i ≤ n), an integer x (1 ≤ x ≤ 10^6), and replace a_j with a_j \% x for all (1 ≤ j ≤ i), which means replace every element in the prefix ending at i with the remainder after dividing it by x. 



Can you make the array strictly increasing in no more than n+1 operations?

Input

The first line contains an integer n (1 ≤ n ≤ 2000), the number of elements in the array a.

The second line contains n space-separated integers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 10^5), the elements of the array a.

Output

On the first line, print the number of operations you wish to perform. On the next lines, you should print the operations.

To print an adding operation, use the format "1 i x"; to print a modding operation, use the format "2 i x". If i or x don't satisfy the limitations above, or you use more than n+1 operations, you'll get wrong answer verdict.

Examples

Input

3
1 2 3


Output

0

Input

3
7 6 3


Output

2
1 1 1
2 2 4

Note

In the first sample, the array is already increasing so we don't need any operations.

In the second sample:

In the first step: the array becomes [8,6,3].

In the second step: the array becomes [0,2,3].

Solution (in JAVA):

Solution:
import java.io.IOException;
import java.awt.color.*;
import java.util.*;
import java.awt.Point;
import java.math.*;
import java.io.*;
import java.util.InputMismatchException;
@SuppressWarnings("unused")
public class prim {int[] b;	 ArrayList<Point> ll;String g="";ArrayList<Point>[] adj;int c=0;long M=1000000000+7;int n;ArrayList<Long> list=new ArrayList<Long>();String s;int[] size;int[] id;
int[]ba;int[] data;int mod=100000;LinkedList<Integer> queue=new LinkedList<Integer>();int dis=0;int max=0;ArrayList<Integer>[] arr;
	public static void main(String[] args) {
                new prim().solve();
                                  }
	long[] fact;long[] inv;
            public void solve() {
            	ArrayList<Integer> list=new ArrayList<Integer>();
            	int n=sc.nextInt();
            	for(int i=0;i<n;i++)
            		list.add(sc.nextInt());
            	System.out.println(n+1);
            	int sum=0;int cc=0;
            	
            	for(int i=n-1;i>=0;i--) {
            		
            		int gg=(sum+list.get(i))%n;
            		int yy=n-1-cc-gg;
            		if(yy<0)
            			yy+=n;
            		System.out.println(1+" "+(i+1)+" "+yy);
            		sum+=yy;
            		cc++;
            	}
            	System.out.println(2+" "+n+" "+n);
            
            	}
                
           
 void prim(int x,int m,int h,int n)
{
	 PriorityQueue<Point> pq=new PriorityQueue<Point>(m*n,new sortbyweight());
    int y;boolean[] marked=new boolean[n+1]; 
    
     long minimumCost = 1;
     ll=new ArrayList<Point>();
    Point zer=new Point(x,1);int w=0;
    pq.add(zer);
    while(pq.size()!=0)
    {
        // Select the edge with minimum weight
       Point p = pq.poll();
       
      int   d = p.x;
        // Checking for cycle
        if(marked[d] == true) 
            continue;
      
        marked[d] = true;
       
        ll.add(p);
        
        for(int i = 0;i < adj[d].size();++i)
        {      Point u=adj[d].get(i);
        
            if(marked[u.x] == false)
                pq.add(u);
        }
    }
    
}
              class sortbyweight implements Comparator<Point>{

				@Override
				public int compare(Point arg0, Point arg1) {
					// TODO Auto-generated method stub
					
					return (int)(arg0.y-arg1.y);
				}
            	  
            	  
				
				
              }

       long root(int x)
       {
           while(id[x] != x)
           {
               id[x] = id[id[x]];
               x = id[x];
           }
           return x;
       }

       void union1(int x, int y)
       {
           long p = root(x);
           long q = root(y);
           id[(int)p] = id[(int)q];
       }
          /*  int root (int Arr[ ] ,int i)
            {
                while(Arr[ i ] != i)
                {   
                    Arr[i] = Arr[ Arr[i] ] ; 
            i = Arr[i]; 
            size[i]=1;
                }
            return i;
            }
          
           
            void weightedunion(int a[ ],int size[ ],int A,int B)
            {
                int root_A = root(a,A);
                int root_B = root(a,B);
                if(root_A!=root_B) {
               
            a[ root_A ] = a[root_B];
           
            
                }

            }*/
            private static int pow(int x, int n) {
                if (n == 0) return 1;
                if (n % 2 == 0) return pow(mul(x, x), n / 2);
                return mul(x, pow(mul(x, x), n / 2));
            } 
            private static int mul(int a, int b) {int M=1000000000+7;
                return (int) (((a % M) * 1L * (b % M)) % M);
            }
            
             
            // Returns n^(-1) mod p
          
            void fact0()
            {fact=new long[1000003];inv =new long[1000003];
            	int i,j;
            	fact[0]=1;
            	for(i=1;i<=200000;i++)
            	{
            		fact[i]=i*fact[i-1]%M;
            	}
            	inv[0]=1;
            	inv[1]=1;
            	long p=M;
            	for (i=2; i<=200000; i++)
            		inv[i] = (p - (p/i) * inv[(int)(p%i)] % p) % p;
            	
            	for(i=2;i<=200000;i++)
            	{
            		inv[i]*=inv[i-1];
            		inv[i]%=M;
            	}
            }
            
            long modularExponentiation(int x,long n,int M)
        	{
        	    long result=1;
        	    while(n>0)
        	    {
        	        if(n % 2 ==1)
        	            result=(result * x)%M;
        	        x=(x*x)%M;
        	        n=n/2;
        	    }
        	    return result;
        	}
                       
       void dfs(int s,int level) {
    	   b[s]=1;
    	   level++;
    	   Iterator<Integer> it=arr[s].iterator();
    	   while(it.hasNext()) {int cc=it.next();
    		   if(b[cc]==0) {
    			   data[level]++;
    			   dfs(cc,level);}
    	   }
       }
       
            
            void possibleway(int[] u,int n,int c,int g) {
            	if(c>=2*n+1)
            		return ;
            	boolean bata=false;
            	for(int i=0;i<2*n;i+=2) {
            		if(u[i]==u[i+1]) {
            			continue;
            		}
            		bata=true;
            	}
            	if(!bata) {
            		list.add((long)c);return ;
            	}
            	for(int i=0;i<2*n-1;i++) {
            		
            		if(i!=g) {
            		      int f=u[i];
            		      u[i]=u[i+1];
            		      u[i+1]=f;
            		possibleway(u, n, c+1,g);}
            	}
            }
            	void bfs(ArrayList[] arr,int y) {
            		
            		
            	
            	
            		while(queue.size()!=0) {
            			int curr=queue.removeFirst();
            			Iterator<Integer> it=arr[curr].iterator();
            			while(it.hasNext()) {
            				int c=it.next();
            				if(b[c]==0) {
            					b[c]=1;
            					b[c]=curr;
            				queue.add(c);
            				if(c==y)
            					break;
            				}
            			}if(c==y)
            				break;
            		}
            	
            	
            	}
            
            
            
            
            
            
            
            
                      public class multipliers implements Comparator<Node>{
            	
            	public int compare(Node a,Node b) {
            		if(a.color<b.color)
            			return 1;
            		else if(b.color<a.color)
            			return -1;
            		else {
            			if(a.x<b.x)
            				return -1;
            			else
            				return 1;}
            		
            	}
            }
         
            	public class Node{
            		long x;long color;long y;
            		Node par;
            		public Node(long a,long b,long c) {
            			x=a;y=b;color=c;
            			
            		}
            	}
            	
            static final int MAXN = 100001;
       	 
        	// stores smallest prime factor for every number
        	static int spf[] = new int[MAXN];
        	 
        	// Calculating SPF (Smallest Prime Factor) for every
        	// number till MAXN.
        	// Time Complexity : O(nloglogn)
        	static void sieve()
        	{
        	    spf[1] = 1;
        	    for (int i=2; i<MAXN; i++)
        	 
        	        // marking smallest prime factor for every
        	        // number to be itself.
        	        spf[i] = i;
        	 
        	    // separately marking spf for every even
        	    // number as 2
        	    for (int i=4; i<MAXN; i+=2)
        	        spf[i] = 2;
        	 
        	    for (int i=3; i*i<MAXN; i++)
        	    {
        	        // checking if i is prime
        	        if (spf[i] == i)
        	        {
        	            // marking SPF for all numbers divisible by i
        	            for (int j=i*i; j<MAXN; j+=i)
        	 
        	                // marking spf[j] if it is not 
        	                // previously marked
        	                if (spf[j]==j)
        	                    spf[j] = i;
        	        }
        	    }
        	}
        	 
        	// A O(log n) function returning primefactorization
        	// by dividing by smallest prime factor at every step
        	static Vector<Integer> getFactorization(int x)
        	{
        	    Vector<Integer> ret = new Vector<>();
        	    while (x != 1)
        	    {
        	        ret.add(spf[x]);
        	        x = x / spf[x];
        	    }
        	    return ret;
        	}
        	 
            int d, x, y;
            void extendedEuclid(int A, int B) {
                if(B == 0) {
                    d = A;
                    x = 1;
                    y = 0;
                }
                else {
                    extendedEuclid(B, A%B);
                    int temp = x;
                    x = y;
                    y = temp - (A/B)*y;
                }
            }
            static final int MAX_SIZE = 1000001;
            // isPrime[] : isPrime[i] is true if number is prime 
            // prime[] : stores all prime number less than N
            // SPF[] that store smallest prime factor of number
            // [for Exp : smallest prime factor of '8' and '16'
            // is '2' so we put SPF[8] = 2 , SPF[16] = 2 ]
            static Vector<Boolean>isprime = new Vector<>(MAX_SIZE);
            static Vector<Integer>prime = new Vector<>();
            static Vector<Integer>SPF = new Vector<>(MAX_SIZE);
              
            // method generate all prime number less then N in O(n)
            static void manipulated_seive(int N)
            {
                // 0 and 1 are not prime
                isprime.set(0, false);
                isprime.set(1, false);
                 
                // Fill rest of the entries
                for (int i=2; i<N ; i++)
                {
                    // If isPrime[i] == True then i is
                    // prime number
                    if (isprime.get(i))
                    {
                        // put i into prime[] vector
                        prime.add(i);
              
                        // A prime number is its own smallest
                        // prime factor
                        SPF.set(i,i);
                    }
              
                    // Remove all multiples of  i*prime[j] which are
                    // not prime by making isPrime[i*prime[j]] = false
                    // and put smallest prime factor of i*Prime[j] as prime[j]
                    // [ for exp :let  i = 5 , j = 0 , prime[j] = 2 [ i*prime[j] = 10 ]
                    // so smallest prime factor of '10' is '2' that is prime[j] ]
                    // this loop run only one time for number which are not prime
                    for (int j=0;
                         j < prime.size() &&
                         i*prime.get(j) < N && prime.get(j) <= SPF.get(i);
                         j++)
                    {
                        isprime.set(i*prime.get(j),false);
              
                        // put smallest prime factor of i*prime[j]
                        SPF.set(i*prime.get(j),prime.get(j)) ;
                    }
                }
            }
            

            int modularExponentiation(long x,long n)
            {
                if(n==0)
                    return 1;
                else if(n%2 == 0)        //n is even
                    return modularExponentiation((x*x),n/2);
                else                             //n is odd
                    return (int) ((x*modularExponentiation((x*x),(n-1)/2)));

            }
            
            
            
         
            long modularExponentiation(long x,long n,long M)
            {
                if(n==0)
                    return 1;
                else if(n%2 == 0)        //n is even
                    return modularExponentiation((x*x)%M,n/2,M);
                else                             //n is odd
                    return (long) ((x*modularExponentiation((x*x)%M,(n-1)/2,M))%M);

            }
            
            
            
            
            
            public int bfs(HashSet<Integer>[] adil,int n){
                int c=0;
                int[] shortdis=new int[n+1];
                Arrays.fill(shortdis,(int)1e5);
                LinkedList<Integer> queue=new LinkedList<Integer>();
                queue.add(1);
                shortdis[1]=0;
                while(queue.size()!=0){
                       int cc=queue.removeFirst();
                       Iterator<Integer> it=adil[cc].iterator();
                       while(it.hasNext()){
                              int f=it.next();
                              if(shortdis[f]==1e5){
                                     shortdis[f]=shortdis[cc]+1;
                                     queue.add(f);
                              }
                       }
                }
                return(shortdis[n]);
         }         
            
          /*  boolean[] sieveOfEratosthenes(int n)
            {
            	
                // (a / b) % m = (a % m * b^(m - 2) % m) % mCreate a boolean array "prime[0..n]" and initialize
                // all entries it as true. A value in prime[i] will
                // finally be false if i is Not a prime, else true.
                boolean prime[] = new boolean[n+1];
                for(int i=0;i<n;i++)
                    prime[i] = true;
                 
                for(int p = 2; p*p <=n; p++)
                {
                    // If prime[p] is not changed, then it is a prime
                    if(prime[p] == true)
                    {
                        // Update all multiples of p
                        for(int i = p*2; i <= n; i += p)
                            prime[i] = false;
                    }
                }
                 
                // Print all prime numbers
               return prime;
            }
            
   /*         void DFS(int v,boolean visited[])
    {
        // Mark the current node as visited and print it
        visited[v] = true;
        System.out.print(v+" ");
 
        // Recur for all the vertices adjacent to this vertex
        Iterator<Integer> i = adj[v].listIterator();
        while (i.hasNext())
        {
            int n = i.next();
            if (!visited[n])
                DFS(n, visited);
        }
    }*/
    /*static int binomialCoeff(int n, int k)
    {
        int C[] = new int[k + 1];
        
        // nC0 is 1
        C[0] = 1;  
      
        for (int i = 1; i <= n; i++)
        {
            // Compute next row of pascal 
            // triangle using the previous row
            for (int j = Math.min(i, k); j > 0; j--)
                C[j] = C[j] + C[j-1];
        }
        return C[k];
    }*/
         
          FastReader sc=new FastReader();
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;
        }
    }
public class Pair implements Comparable<Pair> {
	  final long u;
	  final long v;

	  public Pair(long u, long v) {
	    this.u = u;
	    this.v = v;
	  }

	  public int hashCode() {
	    int hu = (int) (u ^ (u >>> 32));
	    int hv = (int) (v ^ (v >>> 32));
	    return 31 * hu + hv;
	  }

	  public boolean equals(Object o) {
	    Pair other = (Pair) o;
	    return u == other.u && v == other.v;
	  }

	  public int compareTo(Pair other) {
	    return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
	  }

	  public String toString() {
	    return "[u=" + u + ", v=" + v + "]";
	  }


}


}