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;
const int maxn = 300000 + 10;
struct NB {
  long long v, a1, a2;
  int L, R;
  long long lazy1, lazy2;
};
NB node[maxn * 4];
int n, m, a, b, c;
long long f[maxn], ans;
void Build(int o, int L, int R) {
  node[o].L = L;
  node[o].R = R;
  if (L == R) return;
  int mid = (L + R) / 2;
  Build(o * 2, L, mid);
  Build(o * 2 + 1, mid + 1, R);
}
void PushDown(int o) {
  if (node[o].L == node[o].R) return;
  if (node[o].lazy1) {
    long long a1 = node[o].lazy1, a2 = node[o].lazy2, R = node[o * 2].R,
              L = node[o * 2].L;
    node[o * 2].lazy1 = (node[o * 2].lazy1 + a1) % MOD;
    node[o * 2].lazy2 = (node[o * 2].lazy2 + a2) % MOD;
    node[o * 2].v =
        (node[o * 2].v + a1 * f[R - L + 1] + a2 * f[R - L + 2] - a2) % MOD;
    a1 = (node[o].lazy1 * f[R - L] + node[o].lazy2 * f[R - L + 1]) % MOD;
    a2 = (node[o].lazy1 * f[R - L + 1] + node[o].lazy2 * f[R - L + 2]) % MOD;
    R = node[o * 2 + 1].R;
    L = node[o * 2 + 1].L;
    node[o * 2 + 1].lazy1 = (node[o * 2 + 1].lazy1 + a1) % MOD;
    node[o * 2 + 1].lazy2 = (node[o * 2 + 1].lazy2 + a2) % MOD;
    node[o * 2 + 1].v =
        (node[o * 2 + 1].v + a1 * f[R - L + 1] + a2 * f[R - L + 2] - a2) % MOD;
    node[o].lazy1 = node[o].lazy2 = 0;
  }
}
void Update(int o, int L, int R, long long a1, long long a2) {
  if (node[o].L > R || node[o].R < L) return;
  if (node[o].L >= L && node[o].R <= R) {
    node[o].v = (node[o].v + a1 * f[node[o].R - node[o].L + 1] +
                 a2 * f[node[o].R - node[o].L + 2] - a2) %
                MOD;
    node[o].lazy1 = (node[o].lazy1 + a1) % MOD;
    node[o].lazy2 = (node[o].lazy2 + a2) % MOD;
    return;
  }
  PushDown(o);
  int mid = (node[o].L + node[o].R) / 2;
  if (mid < L) {
    Update(o * 2 + 1, L, R, a1, a2);
  } else if (mid >= R) {
    Update(o * 2, L, R, a1, a2);
  } else {
    int ma = max(node[o].L, L);
    Update(o * 2, L, R, a1, a2);
    Update(o * 2 + 1, L, R, (a1 * f[mid - ma] + a2 * f[mid - ma + 1]) % MOD,
           (a1 * f[mid - ma + 1] + a2 * f[mid - ma + 2]) % MOD);
  }
  node[o].v = (node[o * 2].v + node[o * 2 + 1].v) % MOD;
}
void Query(int o, int L, int R) {
  if (node[o].L > R || node[o].R < L) return;
  if (node[o].L >= L && node[o].R <= R) {
    ans = (ans + node[o].v) % MOD;
  } else {
    PushDown(o);
    Query(o * 2, L, R);
    Query(o * 2 + 1, L, R);
  }
}
int main() {
  f[1] = f[2] = 1;
  for (int i = 3; i < maxn; i++) f[i] = (f[i - 1] + f[i - 2]) % MOD;
  scanf("%d%d", &n, &m);
  Build(1, 1, n);
  for (int i = 1; i <= n; i++) scanf("%d", &a), Update(1, i, i, a, 0);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &a, &b, &c);
    if (a == 1) {
      Update(1, b, c, 1, 1);
    } else {
      ans = 0;
      Query(1, b, c);
      printf("%I64d\n", ans);
    }
  }
  return 0;
}
