In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation 

F1 = 1; F2 = 1; Fn = Fn - 1 + Fn - 2 (n > 2).

DZY loves Fibonacci numbers very much. Today DZY gives you an array consisting of n integers: a1, a2, ..., an. Moreover, there are m queries, each query has one of the two types:

  1. Format of the query "1 l r". In reply to the query, you need to add Fi - l + 1 to each element ai, where l ≤ i ≤ r. 
  2. Format of the query "2 l r". In reply to the query you should output the value of <image> modulo 1000000009 (109 + 9). 



Help DZY reply to all the queries.

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 300000). The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — initial array a.

Then, m lines follow. A single line describes a single query in the format given in the statement. It is guaranteed that for each query inequality 1 ≤ l ≤ r ≤ n holds.

Output

For each query of the second type, print the value of the sum on a single line.

Examples

Input

4 4
1 2 3 4
1 1 4
2 1 4
1 2 4
2 1 3


Output

17
12

Note

After the first query, a = [2, 3, 5, 7].

For the second query, sum = 2 + 3 + 5 + 7 = 17.

After the third query, a = [2, 4, 6, 9].

For the fourth query, sum = 2 + 4 + 6 = 12.
import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class FibonacciLove {
    
    private static final int MODULUS = 1000000009;
	private static int[] fibSeq;
    private static int[] fibSum;
	private static int[] fib0;
    private static int[] fib1;
    private static int[] ss;

	private static int sum(int fib0, int fib1, int i, int j)
	{
		int s = i == 0 ? fib0 : 0;
		if (j >= 1)
		{
			int g1 = i <= 1 ? fibSum[j - 1] : (fibSum[j - 1] - fibSum[i - 2] + MODULUS) % MODULUS;
			int fg = (int) ((long) fib1 * g1 % MODULUS);
			s = (s + fg) % MODULUS;
			if (j >= 2)
			{
				int g0 = i <= 2 ? fibSum[j - 2] : (fibSum[j - 2] - fibSum[i - 3] + MODULUS) % MODULUS;
				fg = (int) ((long) fib0 * g0 % MODULUS);
				s = (s + fg) % MODULUS;
			}
		}
		return s;
	}

	private static int iterateQ1(int k, int start, int fin, int nStart, int nRight)
	{
		if (nRight < start || fin < nStart) 
			return 0;

		if (nStart <= start && fin <= nRight) 
		{
			if (start < fin)
			{
				fib0[k] = (fib0[k] + fibSeq[start - nStart]) % MODULUS;
				fib1[k] = (fib1[k] + fibSeq[start - nStart + 1]) % MODULUS;
			}

			int s = start == fin ? fibSeq[start - nStart] : sum(fibSeq[start - nStart], fibSeq[start - nStart + 1], 0, fin - start);
			ss[k] = (ss[k] + s) % MODULUS;
			return s;
		}

		int sstart = iterateQ1(k * 2 + 1, start, (start + fin) / 2, nStart, nRight);
		int sfin = iterateQ1(k * 2 + 2, (start + fin) / 2 + 1, fin, nStart, nRight);
		int s = (sstart + sfin) % MODULUS;
		ss[k] = (ss[k] + s) % MODULUS;
		return s;
	}

	private static int getSum(int k, int start, int fin, int nStart, int nRight)
	{
		if(nRight < start || fin < nStart) 
			return 0;

		if(nStart <= start && fin <= nRight)
			return ss[k];

		int sl = getSum(k * 2 + 1, start, (start + fin) / 2, nStart, nRight);
		int sr = getSum(k * 2 + 2, (start + fin) / 2 + 1, fin, nStart, nRight);
		int s = (sl + sr) % MODULUS;

		int i = Math.max(start, nStart) - start;
		int j = Math.min(fin, nRight) - start;
		int x = sum(fib0[k], fib1[k], i , j);
		s = (s + x) % MODULUS;
		return s;
	}
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] inLine = br.readLine().split(" ");
		int n = Integer.parseInt(inLine[0]);
		int m = Integer.parseInt(inLine[1]);

		inLine = br.readLine().split(" ");
		int[] initialState = new int[n];
		for(int i = 0; i < n; i++)
		{
			int a = Integer.parseInt(inLine[i]);
			initialState[i] = i == 0 ? a : (a + initialState[i-1]) % MODULUS;
		}

		fibSeq = new int[n];
		fibSeq[0] = 1;

		if(n > 1) 
			fibSeq[1] = 1;

		for(int i = 2; i < n; i++)
		{
			fibSeq[i] = (fibSeq[i-1] + fibSeq[i-2]) % MODULUS;
		}

		fibSum = new int[n];
		fibSum[0] = fibSeq[0];

		for(int i = 1; i < n; i++)
		{
			fibSum[i] = (fibSum[i-1] + fibSeq[i]) % MODULUS;
		}

		int t = n * 4;
		fib0 = new int[t];
		fib1 = new int[t];
		ss = new int[t];
        
		PrintWriter out = new PrintWriter(System.out);
		while(m-- > 0)
		{
			inLine = br.readLine().split(" ");
			int qType = Integer.parseInt(inLine[0]);
			int start = Integer.parseInt(inLine[1]) - 1;
			int fin = Integer.parseInt(inLine[2]) - 1;

			if(qType == 1) 
			{
				int s = iterateQ1(0, 0, n - 1, start, fin);
			}
			else if(qType == 2)
			{
				int s = getSum(0, 0, n - 1, start, fin);
				int a = start == 0 ? initialState[fin] : (initialState[fin] - initialState[start - 1] + MODULUS) % MODULUS;
				s = (s + a) % MODULUS;
				out.println(s);
			}
		}
		out.close();
    }
}