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.util.*;
import java.lang.*;
import java.io.*;

public class Fib
{
  static final int MOD = 1000000009;
  static int[] fibSeq, fibSum;
  static int[] f0,f1,ss;

  static int sum(int f0, int f1, int i, int j)
  {
    int s = i == 0 ? f0 : 0;
    if (j >= 1){
      int g1 = i <= 1 ? fibSum[j - 1] : (fibSum[j - 1] - fibSum[i - 2] + MOD) % MOD;
      int fg = (int) ((long) f1 * g1 % MOD);
      s = (s + fg) % MOD;
      if (j >= 2){
        int g0 = i <= 2 ? fibSum[j - 2] : (fibSum[j - 2] - fibSum[i - 3] + MOD) % MOD;
        fg = (int) ((long) f0 * g0 % MOD);
        s = (s + fg) % MOD;
      }
    }
    return s;
  }
  
  // Recursive query to add Fi-l+1 to each element ai, where l <= i <= r
  // left -> left limit
  // right -> right limit
  // qLeft -> query left limit
  // qRight -> query right limit
  static int updateElements(int k, int left, int right, int qLeft, int qRight)
  {
    if (qRight < left || right < qLeft) return 0;

    if (qLeft <= left && right <= qRight) 
    {
      if (left < right){
        f0[k] = (f0[k] + fibSeq[left - qLeft]) % MOD;
        f1[k] = (f1[k] + fibSeq[left - qLeft + 1]) % MOD;
      }
      int s = left == right ? fibSeq[left - qLeft] : sum(fibSeq[left - qLeft], fibSeq[left - qLeft + 1], 0, right - left);
      ss[k] = (ss[k] + s) % MOD;
      return s;
    }

    int sleft = updateElements(k * 2 + 1, left, (left + right) / 2, qLeft, qRight);
    int sright = updateElements(k * 2 + 2, (left + right) / 2 + 1, right, qLeft, qRight);
    int s = (sleft + sright) % MOD;
    ss[k] = (ss[k] + s) % MOD;
    return s;
  }
  
  // Recursive query to get the sum value of elements within range
  // left -> left limit
  // right -> right limit
  // qLeft -> query left limit
  // qRight -> query right limit
  static int getSum(int k, int left, int right, int qLeft, int qRight)
  {
    if(qRight < left || right < qLeft) return 0;
    
    if(qLeft <= left && right <= qRight) return ss[k];
    
    int sl = getSum(k * 2 + 1, left, (left + right) / 2, qLeft, qRight);
    int sr = getSum(k * 2 + 2, (left + right) / 2 + 1, right, qLeft, qRight);
    int s = (sl + sr) % MOD;
    
    int i = Math.max(left, qLeft) - left;
    int j = Math.min(right, qRight) - left;
    int x = sum(f0[k], f1[k], i , j);
    s = (s + x) % MOD;
    return s;
  }
  
  public static void main (String[] args) throws java.lang.Exception
  {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(System.out);
    
    String[] input = br.readLine().split(" ");
    int n = Integer.parseInt(input[0]);
    int m = Integer.parseInt(input[1]);
    
    input = br.readLine().split(" ");
    int[] initArr = new int[n];
    for(int i = 0; i < n; i++){
      int a = Integer.parseInt(input[i]);
      initArr[i] = i == 0 ? a : (a + initArr[i-1]) % MOD;
      //pw.println("initArr[i] = " + initArr[i]);
    }
    
    // Generate fibonacci sequence
    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]) % MOD;
    }
    
    fibSum = new int[n];
    fibSum[0] = fibSeq[0];
    for(int i = 1; i < n; i++){
      fibSum[i] = (fibSum[i-1] + fibSeq[i]) % MOD;
    }
    
    /*for(int i = 0; i < n; i++){
      pw.println("fibSeq[i] = " + fibSeq[i] + " fibSum[i] = " + fibSum[i]);
    }*/

    // Initialize arrays to "magic" size that will be enough
    int t = n * 4;
    f0 = new int[t];
    f1 = new int[t];
    ss = new int[t];
    
    // Read through queries performing appropriate ones
    while(m-- > 0)
    {
      input = br.readLine().split(" ");
      int qType = Integer.parseInt(input[0]);
      int left = Integer.parseInt(input[1]) - 1;
      int right = Integer.parseInt(input[2]) - 1;
      
      if(qType == 1) 
      {
        int s = updateElements(0, 0, n - 1, left, right);
        //pw.println("updateElements = " + s);
      }
      else if(qType == 2)
      {
        int s = getSum(0, 0, n - 1, left, right);
        //pw.println("getSum = " + s);
        int a = left == 0 ? initArr[right] : (initArr[right] - initArr[left - 1] + MOD) % MOD;
        //pw.println("a = " + a);
        s = (s + a) % MOD;
        pw.println(s);
      }
    }
    pw.close();
  }
}