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 N = 300000, MOD = 1000000009;
long long arr[N], presum[N];
struct matrix {
  long long a00, a01, a10, a11;
  matrix() {
    a00 = 0;
    a01 = 0;
    a10 = 0;
    a11 = 0;
  }
  matrix(long long a, long long b, long long c, long long d) {
    a00 = a;
    a01 = b;
    a10 = c;
    a11 = d;
  }
  matrix operator*(matrix &b) {
    matrix ret;
    ret.a00 = (a00 * b.a00 % MOD + a01 * b.a10 % MOD) % MOD;
    ret.a01 = (a00 * b.a01 % MOD + a01 * b.a11 % MOD) % MOD;
    ret.a10 = (a10 * b.a00 % MOD + a11 * b.a10 % MOD) % MOD;
    ret.a11 = (a10 * b.a01 % MOD + a11 * b.a11 % MOD) % MOD;
    return ret;
  }
  matrix operator-(matrix &b) {
    matrix ret;
    ret.a00 = (a00 - b.a00 + MOD) % MOD;
    ret.a01 = (a01 - b.a01 + MOD) % MOD;
    ret.a10 = (a10 - b.a10 + MOD) % MOD;
    ret.a11 = (a11 - b.a11 + MOD) % MOD;
    return ret;
  }
  matrix operator+(matrix &b) {
    matrix ret;
    ret.a00 = (a00 + b.a00) % MOD;
    ret.a01 = (a01 + b.a01) % MOD;
    ret.a10 = (a10 + b.a10) % MOD;
    ret.a11 = (a11 + b.a11) % MOD;
    return ret;
  }
  bool operator==(matrix &b) {
    if ((a00 == b.a00) && (a01 == b.a01) && (a10 == b.a10) && (a11 == b.a11))
      return true;
    return false;
  }
  bool operator!=(matrix &b) {
    if (*this == b) return false;
    return true;
  }
  void show() { cout << a01 << endl; }
};
matrix I(1, 0, 0, 1), B(1, 1, 1, 0), Z;
matrix fib[N + 10];
matrix lazy[5 * N];
long long st[5 * N];
void updlazy(int node, int l, int r) {
  if (lazy[node] == Z) return;
  matrix temp = fib[r - l + 3] - fib[2];
  temp = temp * lazy[node];
  st[node] = (st[node] + temp.a01) % MOD;
  temp = lazy[node] * fib[(l + r) / 2 - l + 1];
  if (l != r) {
    lazy[2 * node + 1] = lazy[2 * node + 1] + lazy[node];
    lazy[2 * node + 2] = lazy[2 * node + 2] + temp;
  }
  lazy[node] = Z;
  return;
}
void update(int node, int l, int r, int ql, int qr) {
  updlazy(node, l, r);
  if (l > r || ql > r || qr < l) return;
  if (ql <= l && qr >= r) {
    int cl = l - ql + 1, cr = r - ql + 1, nel = (l + r) / 2 - l + 1;
    st[node] = (st[node] + fib[cr + 2].a01 - fib[cl + 1].a01 + MOD) % MOD;
    if (l != r) {
      lazy[2 * node + 1] = lazy[2 * node + 1] + fib[cl - 1];
      lazy[2 * node + 2] = lazy[2 * node + 2] + fib[cl - 1 + nel];
    }
    return;
  }
  update(2 * node + 1, l, (l + r) / 2, ql, qr);
  update(2 * node + 2, (l + r) / 2 + 1, r, ql, qr);
  st[node] = (st[2 * node + 1] + st[2 * node + 2]) % MOD;
}
long long query(int node, int l, int r, int ql, int qr) {
  updlazy(node, l, r);
  if (l > r || ql > r || qr < l) return 0;
  if (ql <= l && qr >= r) return st[node];
  return (query(2 * node + 1, l, (l + r) / 2, ql, qr) +
          query(2 * node + 2, (l + r) / 2 + 1, r, ql, qr)) %
         MOD;
}
int main() {
  int n, m;
  long long ans = 0;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &arr[i]);
    presum[i] = arr[i];
  }
  for (int i = 1; i < n; ++i) {
    presum[i] += presum[i - 1];
    presum[i] %= MOD;
  }
  fib[0] = I;
  fib[1] = B;
  for (int i = 2; i < N + 10; ++i) fib[i] = fib[i - 1] * B;
  while (m--) {
    int t, l, r;
    scanf("%d %d %d", &t, &l, &r);
    l--, r--;
    if (t == 1)
      update(0, 0, n, l, r);
    else {
      ans = (presum[r] - (l == 0 ? 0 : presum[l - 1]) + MOD) % MOD;
      ans = (ans + query(0, 0, n, l, r)) % MOD;
      printf("%lld\n", ans);
    }
  }
}
