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 mod = 1000000009, MAXN = 300010;
struct node {
  int v, prvi, drugi;
  node() { v = prvi = drugi = 0; }
} tur[(1 << 21) + 10];
int mat[MAXN][2][2], prijelaz_mat[2][2];
int suma[MAXN][3][3], prijelaz_suma[3][3];
int n, off;
void mnozi_mat(int indeks, int mat1[2][2], int mat2[2][2]) {
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++)
        mat[indeks][i][j] =
            ((long long int)mat1[i][k] * mat2[k][j] + mat[indeks][i][j]) % mod;
}
void postavi_fibonacci() {
  mat[0][0][0] = 1;
  mat[0][0][1] = 0;
  mat[0][1][0] = 0;
  mat[0][1][1] = 1;
  mat[1][0][0] = 1;
  mat[1][0][1] = 0;
  mat[1][1][0] = 0;
  mat[1][1][1] = 1;
  prijelaz_mat[0][0] = 0;
  prijelaz_mat[0][1] = 1;
  prijelaz_mat[1][0] = 1;
  prijelaz_mat[1][1] = 1;
  for (int i = 2; i < MAXN; i++) mnozi_mat(i, mat[i - 1], prijelaz_mat);
}
void mnozi_suma(int indeks, int mat1[3][3], int mat2[3][3]) {
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      for (int k = 0; k < 3; k++)
        suma[indeks][i][j] =
            ((long long int)mat1[i][k] * mat2[k][j] + suma[indeks][i][j]) % mod;
}
void postavi_suma() {
  suma[0][0][0] = 1;
  suma[0][0][1] = 0;
  suma[0][0][2] = 0;
  suma[0][1][0] = 0;
  suma[0][1][1] = 1;
  suma[0][1][2] = 0;
  suma[0][2][0] = 0;
  suma[0][2][1] = 0;
  suma[0][2][2] = 1;
  prijelaz_suma[0][0] = 1;
  prijelaz_suma[0][1] = 1;
  prijelaz_suma[0][2] = 0;
  prijelaz_suma[1][0] = 0;
  prijelaz_suma[1][1] = 0;
  prijelaz_suma[1][2] = 1;
  prijelaz_suma[2][0] = 0;
  prijelaz_suma[2][1] = 1;
  prijelaz_suma[2][2] = 1;
  for (int i = 1; i < MAXN; i++) mnozi_suma(i, suma[i - 1], prijelaz_suma);
}
node spoji(node x, node y) {
  node ret;
  ret.v = (x.v + y.v) % mod;
  return ret;
}
void postavi(int x) {
  for (int i = x / 2; i > 0; i /= 2) tur[i] = spoji(tur[2 * i], tur[2 * i + 1]);
}
int xth_fib(int x, int prvi, int drugi) {
  int ret = 0;
  ret = (ret + (long long int)prvi * mat[x][0][0]) % mod;
  ret = (ret + (long long int)drugi * mat[x][0][1]) % mod;
  return ret;
}
int suma_prvih_x(int x, int prvi, int drugi) {
  int ret = 0;
  ret = (ret + (long long int)prvi * suma[x][0][1]) % mod;
  ret = (ret + (long long int)drugi * suma[x][0][2]) % mod;
  return ret;
}
void refresh(int cvor, int a, int b) {
  if (tur[cvor].prvi == 0 && tur[cvor].drugi == 0) return;
  int l = b - a + 1;
  if (l > 1) {
    tur[2 * cvor].prvi = (tur[2 * cvor].prvi + tur[cvor].prvi) % mod;
    tur[2 * cvor].drugi = (tur[2 * cvor].drugi + tur[cvor].drugi) % mod;
    tur[2 * cvor + 1].prvi =
        (tur[2 * cvor + 1].prvi +
         xth_fib(l / 2 + 1, tur[cvor].prvi, tur[cvor].drugi)) %
        mod;
    tur[2 * cvor + 1].drugi =
        (tur[2 * cvor + 1].drugi +
         xth_fib(l / 2 + 2, tur[cvor].prvi, tur[cvor].drugi)) %
        mod;
  }
  tur[cvor].v =
      (tur[cvor].v + suma_prvih_x(l, tur[cvor].prvi, tur[cvor].drugi)) % mod;
  tur[cvor].prvi = 0;
  tur[cvor].drugi = 0;
}
void update(int cvor, int a, int b, int poc, int kraj) {
  if (a > kraj || b < poc) return;
  refresh(cvor, a, b);
  if (a >= poc && b <= kraj) {
    tur[cvor].prvi = (tur[cvor].prvi + xth_fib(a - poc + 1, 1, 1)) % mod;
    tur[cvor].drugi = (tur[cvor].drugi + xth_fib(a - poc + 2, 1, 1)) % mod;
    refresh(cvor, a, b);
    return;
  }
  update(2 * cvor, a, (a + b) / 2, poc, kraj);
  update(2 * cvor + 1, (a + b) / 2 + 1, b, poc, kraj);
  refresh(2 * cvor, a, (a + b) / 2);
  refresh(2 * cvor + 1, (a + b) / 2 + 1, b);
  tur[cvor] = spoji(tur[2 * cvor], tur[2 * cvor + 1]);
}
int query(int cvor, int a, int b, int poc, int kraj) {
  if (a > kraj || b < poc) return 0;
  refresh(cvor, a, b);
  if (a >= poc && b <= kraj) return tur[cvor].v;
  return (query(2 * cvor, a, (a + b) / 2, poc, kraj) +
          query(2 * cvor + 1, (a + b) / 2 + 1, b, poc, kraj)) %
         mod;
}
void ispis() {
  for (int i = 0; i < off; i++) query(1, 0, off - 1, i, i);
  int next = 1;
  for (int i = 1; i < 2 * off; i++) {
    if (next == i) {
      cout << endl;
      next *= 2;
    }
    cout << tur[i].v << " ";
  }
  cout << endl << "***************" << endl;
}
int main() {
  int m;
  scanf("%d %d", &n, &m);
  postavi_fibonacci();
  postavi_suma();
  for (off = 1; off < n; off *= 2)
    ;
  for (int i = off; i < off + n; i++) scanf("%d", &tur[i].v);
  for (int i = off; i < 2 * off; i++) postavi(i);
  for (int i = 0; i < m; i++) {
    int q, a, b;
    scanf("%d %d %d", &q, &a, &b);
    a--;
    b--;
    if (q == 1)
      update(1, 0, off - 1, a, b);
    else
      printf("%d\n", query(1, 0, off - 1, a, b));
  }
  return 0;
}
