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>
const int mod = 1000000009;
const int N = 300010;
int a[N], l[N << 2], r[N << 2];
long long s[N << 2], f1[N << 2], f2[N << 2];
bool f[N << 2];
long long F[N], G[N], K[N];
inline void in(int &x) {
  char c = getchar();
  x = 0;
  while (c < 48 || c > 57) c = getchar();
  while (c >= 48 && c <= 57) {
    x = x * 10 + c - 48;
    c = getchar();
  }
}
void maintain(int o) { s[o] = (s[o << 1] + s[(o << 1) | 1]) % mod; }
void build(int o, int ll, int rr) {
  l[o] = ll;
  r[o] = rr;
  f[o] = 0;
  if (ll < rr) {
    int m = (ll + rr) >> 1;
    build(o << 1, ll, m);
    build((o << 1) | 1, m + 1, rr);
    maintain(o);
  } else {
    s[o] = a[ll];
  }
}
void update(int o, int ll, int rr, long long v1, long long v2);
void pushdown(int o) {
  if (f[o]) {
    int m = (l[o] + r[o]) >> 1;
    update(o << 1, l[o], m, f1[o], f2[o]);
    int x = m + 1 - l[o];
    long long t1 = (K[x] * f1[o] % mod + K[x + 1] * f2[o] % mod) % mod;
    long long t2 = (K[x + 1] * f1[o] % mod + K[x + 2] * f2[o] % mod) % mod;
    update((o << 1) | 1, m + 1, r[o], t1, t2);
    f[o] = 0;
  }
}
void update(int o, int ll, int rr, long long v1, long long v2) {
  if (l[o] == ll && r[o] == rr) {
    int len = rr - ll + 1;
    s[o] = (s[o] + F[len] * v1 % mod + G[len] * v2 % mod) % mod;
    if (!f[o]) {
      f1[o] = v1;
      f2[o] = v2;
      f[o] = 1;
    } else {
      f1[o] = (f1[o] + v1) % mod;
      f2[o] = (f2[o] + v2) % mod;
    }
    return;
  }
  pushdown(o);
  int m = (l[o] + r[o]) >> 1;
  if (rr <= m)
    update(o << 1, ll, rr, v1, v2);
  else if (ll > m)
    update((o << 1) | 1, ll, rr, v1, v2);
  else {
    update(o << 1, ll, m, v1, v2);
    int x = m + 1 - ll;
    long long t1 = (K[x] * v1 % mod + K[x + 1] * v2 % mod) % mod;
    long long t2 = (K[x + 1] * v1 % mod + K[x + 2] * v2 % mod) % mod;
    update((o << 1) | 1, m + 1, rr, t1, t2);
  }
  maintain(o);
}
long long query(int o, int ll, int rr) {
  if (l[o] == ll && r[o] == rr) return s[o];
  pushdown(o);
  int m = (l[o] + r[o]) >> 1;
  long long tmp = 0;
  if (rr <= m)
    tmp = query(o << 1, ll, rr);
  else if (ll > m)
    tmp = query((o << 1) | 1, ll, rr);
  else {
    tmp = (query(o << 1, ll, m) + query((o << 1) | 1, m + 1, rr)) % mod;
  }
  if (tmp < 0) {
    tmp = (tmp % mod + mod) % mod;
  }
  maintain(o);
  return tmp;
}
int main() {
  F[0] = G[0] = 0;
  F[1] = 1;
  G[1] = 0;
  K[0] = 1;
  K[1] = 0;
  for (int i = 2; i < N; i++) {
    F[i] = (F[i - 1] + F[i - 2]) % mod;
    G[i] = (G[i - 1] + F[i - 1]) % mod;
    K[i] = (K[i - 1] + K[i - 2]) % mod;
  }
  int n, m;
  in(n);
  in(m);
  for (int i = 1; i <= n; i++) in(a[i]);
  build(1, 1, n);
  int op, x, y;
  while (m--) {
    in(op);
    in(x);
    in(y);
    if (op & 1) {
      update(1, x, y, 1, 1);
    } else {
      printf("%I64d\n", query(1, x, y));
    }
  }
  return 0;
}
