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.
#include <bits/stdc++.h>
using namespace std;
const int MM = 1000000009;
const int MX = 300000;
struct mat {
  long long t[2][2];
  mat operator*(const mat &l) const {
    mat ans = {{0}};
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        for (int k = 0; k < 2; k++) {
          ans.t[i][j] += t[i][k] * l.t[k][j];
          ans.t[i][j] %= MM;
          ans.t[i][j] = (ans.t[i][j] + MM) % MM;
        }
      }
    }
    return ans;
  }
};
struct BIT {
  long long t[MX + 5];
  void update(int wi, long long su) {
    if (wi == 0) return;
    while (wi <= MX + 4) {
      t[wi] = (t[wi] + su + MM) % MM;
      wi += wi & (-wi);
    }
  }
  long long read(int wi) {
    if (wi == 0) return 0;
    long long ans = 0;
    while (wi > 0) {
      ans = (ans + t[wi] + MM) % MM;
      wi -= wi & (-wi);
    }
    return ans;
  }
} ini, F1, F2, add;
long long DB[MX + 5], fibo[MX + 5];
long long solve(int wi) {
  long long f1 = F1.read(wi), f2 = F2.read(wi),
            ad = add.read(wi) + ini.read(wi), tot = 0;
  mat mul = {1, 1, 1, 0}, ans = {1, 0, 0, 1};
  int ln = wi - 2;
  tot += ad;
  while (ln > 0) {
    if (ln % 2 == 1) ans = mul * ans;
    ln /= 2;
    mul = mul * mul;
  }
  if (wi == 1)
    tot += f1;
  else
    tot += f2 * ans.t[0][0] + f1 * ans.t[0][1];
  tot %= MM;
  return tot;
}
int main() {
  int N, M;
  DB[0] = 3, DB[1] = 2;
  fibo[1] = 1, fibo[2] = 1;
  for (int i = 2; i <= MX + 4; i++) DB[i] = (DB[i - 2] - DB[i - 1] + MM) % MM;
  for (int i = 3; i <= MX + 4; i++) fibo[i] = (fibo[i - 1] + fibo[i - 2]) % MM;
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) {
    int A;
    scanf("%d", &A);
    ini.update(i, A);
  }
  for (int i = 1; i <= M; i++) {
    int o, l, r;
    scanf("%d%d%d", &o, &l, &r);
    if (o == 1) {
      F1.update(r + 1, -DB[l]);
      F1.update(l, DB[l]);
      F2.update(r + 1, -DB[l - 1]);
      F2.update(l, DB[l - 1]);
      add.update(l, -1);
      add.update(r + 1, fibo[r - l + 3]);
    } else {
      printf("%lld\n", (solve(r) - solve(l - 1) + MM) % MM);
    }
  }
}
