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 = 300007, M = 1000000009;
int a[N], fib[N];
int seg[4 * N];
pair<int, int> lazy[4 * N];
vector<vector<int>> pre[N];
inline int add(int x, int y) { return (x + y) % M; }
inline int add(int x, int y, int z) { return add(add(x, y), z); }
inline pair<int, int> add(pair<int, int> a, pair<int, int> b) {
  return pair<int, int>(add(a.first, b.first), add(a.second, b.second));
}
inline int mul(int a, int b) { return (long long)a * b % M; }
void build(int p, int l, int r) {
  if (l == r) {
    seg[p] = a[l];
  } else {
    build(2 * p, l, ((l + r) / 2));
    build(2 * p + 1, ((l + r) / 2) + 1, r);
    seg[p] = add(seg[2 * p], seg[2 * p + 1]);
  }
}
vector<vector<int>> mult(vector<vector<int>> a, vector<vector<int>> b) {
  vector<vector<int>> ans(a.size(), vector<int>(b[0].size(), 0));
  for (int i = 0; i < ans.size(); ++i) {
    for (int j = 0; j < ans[i].size(); ++j) {
      for (int k = 0; k < a[i].size(); ++k) {
        ans[i][j] = add(ans[i][j], mul(a[i][k], b[k][j]));
      }
    }
  }
  return ans;
}
vector<vector<int>> transp(vector<vector<int>> a) {
  vector<vector<int>> m(a[0].size(), vector<int>(a.size(), 0));
  for (int i = 0; i < m.size(); ++i) {
    for (int j = 0; j < m[i].size(); ++j) {
      m[i][j] = a[j][i];
    }
  }
  return m;
}
vector<int> calc(int x0, int x1, int sz) {
  if (sz == 1) return {0, x0, x0};
  int aux = add(x0, x1);
  vector<vector<int>>& m = pre[sz - 2];
  return {add(mul(m[0][0], x1), mul(m[0][1], x0), mul(m[0][2], aux)),
          add(mul(m[1][0], x1), mul(m[1][1], x0), mul(m[1][2], aux)),
          add(mul(m[2][0], x1), mul(m[2][1], x0), mul(m[2][2], aux))};
}
void prop(int p, int l, int r) {
  if (lazy[p].first or lazy[p].second) {
    seg[p] = add(seg[p], calc(lazy[p].first, lazy[p].second, r - l + 1)[2]);
  }
  if (l != r and (lazy[p].first or lazy[p].second)) {
    if (r == l + 1) {
      lazy[2 * p].first = add(lazy[2 * p].first, lazy[p].first);
      lazy[2 * p + 1].first = add(lazy[2 * p + 1].first, lazy[p].second);
    } else {
      lazy[2 * p] = add(lazy[2 * p], lazy[p]);
      auto aux = calc(lazy[p].first, lazy[p].second, ((l + r) / 2) + 2 - l + 1);
      lazy[2 * p + 1] = add(lazy[2 * p + 1], pair<int, int>(aux[1], aux[0]));
    }
  }
  lazy[p] = pair<int, int>(0, 0);
}
void update(int p, int l, int r, int a, int b) {
  prop(p, l, r);
  if (r < a or l > b) return;
  if (l >= a and r <= b) {
    lazy[p] =
        add(lazy[p], pair<int, int>(fib[l - a], l == r ? 0 : fib[l - a + 1]));
    prop(p, l, r);
  } else {
    update(2 * p, l, ((l + r) / 2), a, b);
    update(2 * p + 1, ((l + r) / 2) + 1, r, a, b);
    seg[p] = add(seg[2 * p], seg[2 * p + 1]);
  }
}
int query(int p, int l, int r, int a, int b) {
  prop(p, l, r);
  if (r < a or l > b) return 0;
  if (l >= a and r <= b) {
    return seg[p];
  } else {
    return add(query(2 * p, l, ((l + r) / 2), a, b),
               query(2 * p + 1, ((l + r) / 2) + 1, r, a, b));
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  pre[0] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
  for (int i = 1; i < n; ++i) {
    pre[i] = mult(pre[i - 1], {{1, 1, 0}, {1, 0, 0}, {1, 1, 1}});
  }
  fib[0] = 1, fib[1] = 1;
  for (int i = 2; i < n; ++i) fib[i] = (fib[i - 1] + fib[i - 2]) % M;
  for (int i = 0; i < n; ++i) cin >> a[i];
  build(1, 0, n - 1);
  for (int i = 0; i < m; ++i) {
    int op, l, r;
    cin >> op >> l >> r;
    l--, r--;
    if (op == 1) {
      update(1, 0, n - 1, l, r);
    } else {
      cout << query(1, 0, n - 1, l, r) << '\n';
    }
  }
}
