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>
void fib(int *gg, int n, int g0, int g1) {
  int i;
  gg[0] = g0;
  if (n > 1) gg[1] = g1;
  for (i = 2; i < n; i++) gg[i] = (gg[i - 1] + gg[i - 2]) % 1000000009;
}
int aa[300000];
int cc[300000];
int ff[300000];
int gg[300000];
int bb[300000];
int f0[300000];
int f1[300000];
int main() {
  int n, m, p, k, i, j;
  memset(aa, 0, 300000 * sizeof(int));
  memset(bb, 0, 300000 * sizeof(int));
  memset(f0, 0, 300000 * sizeof(int));
  memset(f1, 0, 300000 * sizeof(int));
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    cc[i] = i == 0 ? a : (a + cc[i - 1]) % 1000000009;
  }
  fib(ff, n, 1, 1);
  p = (int)sqrt(n) / 2 + 1;
  k = n / p + 1;
  while (m-- > 0) {
    int q, l, r, u, v;
    scanf("%d%d%d", &q, &l, &r);
    l--;
    r--;
    u = l / p;
    v = r / p;
    if (q == 1) {
      if (u == v) {
        for (i = l; i <= r; i++) {
          aa[i] = (aa[i] + ff[i - l]) % 1000000009;
          bb[u] = (bb[u] + ff[i - l]) % 1000000009;
        }
      } else {
        for (i = l; i < (u + 1) * p; i++) {
          aa[i] = (aa[i] + ff[i - l]) % 1000000009;
          bb[u] = (bb[u] + ff[i - l]) % 1000000009;
        }
        for (i = v * p; i <= r; i++) {
          aa[i] = (aa[i] + ff[i - l]) % 1000000009;
          bb[v] = (bb[v] + ff[i - l]) % 1000000009;
        }
      }
      for (j = u + 1; j < v; j++) {
        f0[j] = (f0[j] + ff[j * p - l]) % 1000000009;
        f1[j] = (f1[j] + ff[j * p + 1 - l]) % 1000000009;
      }
    } else if (q == 2) {
      int sum = l == 0 ? cc[r] : (cc[r] - cc[l - 1] + 1000000009) % 1000000009;
      int g0, g1;
      if (u == v) {
        fib(gg, p, f0[u], f1[u]);
        for (i = l; i <= r; i++) {
          sum = (sum + aa[i]) % 1000000009;
          sum = (sum + gg[i % p]) % 1000000009;
        }
      } else {
        fib(gg, p, f0[u], f1[u]);
        for (i = l; i < (u + 1) * p; i++) {
          sum = (sum + aa[i]) % 1000000009;
          sum = (sum + gg[i % p]) % 1000000009;
        }
        fib(gg, p, f0[v], f1[v]);
        for (i = v * p; i <= r; i++) {
          sum = (sum + aa[i]) % 1000000009;
          sum = (sum + gg[i % p]) % 1000000009;
        }
      }
      for (j = u + 1; j < v; j++) sum = (sum + bb[j]) % 1000000009;
      g0 = 0;
      g1 = 0;
      for (j = u + 1; j < v; j++) {
        g0 = (g0 + f0[j]) % 1000000009;
        g1 = (g1 + f1[j]) % 1000000009;
      }
      fib(gg, p, g0, g1);
      for (i = 0; i < p; i++) sum = (sum + gg[i]) % 1000000009;
      printf("%d\n", sum);
    }
  }
}
