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 long long MOD = 1000000009;
const int MAXN = 1200004;
int n, m, ql, qr, a[MAXN];
long long fib[MAXN], sum[MAXN];
long long s[MAXN], c1[MAXN], c2[MAXN];
struct MAT {
  long long a[2][2];
} f[MAXN], sf[MAXN];
void mul(MAT &a, MAT &b, MAT &c) {
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) {
      c.a[i][j] = 0;
      for (int k = 0; k < 2; k++) c.a[i][j] += a.a[i][k] * b.a[k][j];
      c.a[i][j] %= MOD;
    }
}
void build(int o, int l, int r) {
  c1[o] = c2[o] = 0;
  if (l == r) {
    s[o] = a[l];
    return;
  }
  int m = (l + r) / 2;
  build(o * 2, l, m);
  build(o * 2 + 1, m + 1, r);
  s[o] = (s[o * 2] + s[o * 2 + 1]) % MOD;
}
void add(int o, int l, int r, long long d1, long long d2) {
  s[o] = (s[o] + d1 * sf[r - l + 1].a[0][0] + d2 * sf[r - l + 1].a[0][1]) % MOD;
  c1[o] = (c1[o] + d1) % MOD;
  c2[o] = (c2[o] + d2) % MOD;
}
void down(int o, int l, int r) {
  int m = (l + r) / 2;
  add(o * 2, l, m, c1[o], c2[o]);
  long long d1 = (c1[o] * f[m + 1 - l].a[0][0] + c2[o] * f[m + 1 - l].a[0][1]) %
                 MOD,
            d2 = (c1[o] * f[m + 1 - l].a[1][0] + c2[o] * f[m + 1 - l].a[1][1]) %
                 MOD;
  add(o * 2 + 1, m + 1, r, d1, d2);
  c1[o] = c2[o] = 0;
}
long long query(int o, int l, int r) {
  if ((ql <= l) && (r <= qr)) return s[o];
  int m = (l + r) / 2;
  down(o, l, r);
  long long ret = 0;
  if (ql <= m) ret += query(o * 2, l, m);
  if (m < qr) ret += query(o * 2 + 1, m + 1, r);
  return ret % MOD;
}
void update(int o, int l, int r) {
  if ((ql <= l) && (r <= qr)) {
    add(o, l, r, fib[l - ql + 1], fib[l - ql]);
    return;
  }
  int m = (l + r) / 2;
  down(o, l, r);
  if (ql <= m) update(o * 2, l, m);
  if (m < qr) update(o * 2 + 1, m + 1, r);
  s[o] = (s[o * 2] + s[o * 2 + 1]) % MOD;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  fib[0] = 0;
  fib[1] = 1;
  for (int i = 2; i <= n; i++) fib[i] = (fib[i - 2] + fib[i - 1]) % MOD;
  f[1].a[0][0] = f[1].a[0][1] = f[1].a[1][0] = 1;
  f[1].a[1][1] = 0;
  for (int i = 2; i <= n; i++) mul(f[i - 1], f[1], f[i]);
  sf[1].a[0][0] = 1;
  sf[1].a[0][1] = sf[1].a[1][0] = sf[1].a[1][1] = 0;
  for (int i = 2; i <= n; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++)
        sf[i].a[j][k] = (sf[i - 1].a[j][k] + f[i - 1].a[j][k]) % MOD;
  build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    int op;
    scanf("%d%d%d", &op, &ql, &qr);
    if (op == 1)
      update(1, 1, n);
    else
      printf("%d\n", (int)query(1, 1, n));
  }
  return 0;
}
