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 = 1e9 + 9;
const int phi = 691504013;
const int sai = 308495997;
const int sq5 = 383008016;
const int isq5 = 276601605;
int phiTable[400000] = {1}, saiTable[400000] = {1};
int powM(int a, int p) {
  if (a == phi) return phiTable[p];
  if (a == sai) return saiTable[p];
  assert(0);
}
int inv(int x) {
  if (x == phi - 1) return 691504013;
  if (x == sai - 1) return 308495997;
  assert(0);
}
class Seg {
  int a, x;
  int l, m, r;
  int sum;
  Seg* ch[2];
  int size() { return r - l; }
  void modAdd(int& a, int b) {
    a += b;
    if (a >= MOD) a -= MOD;
  }
  int calc(int a) {
    if (x == 1) return 1ll * a * size() % MOD;
    return 1ll * a * (powM(x, size()) - 1) % MOD * inv(x - 1) % MOD;
  }
  void pull() {
    sum = ch[0]->sum + ch[1]->sum;
    if (sum >= MOD) sum -= MOD;
  }
  void push() {
    if (a) {
      for (int i = 0; i < 2; ++i) {
        int na = 1ll * a * powM(x, i ? ch[0]->size() : 0) % MOD;
        modAdd(ch[i]->a, na);
        modAdd(ch[i]->sum, ch[i]->calc(na));
      }
      a = 0;
    }
  }

 public:
  Seg(int l, int r, long long x) : l(l), r(r), m(l + r >> 1), x(x), a(0) {
    if (r - l == 1)
      sum = 0;
    else {
      ch[0] = new Seg(l, m, x);
      ch[1] = new Seg(m, r, x);
      pull();
    }
  }
  void add(int ql, int qr, long long qa) {
    if (ql <= l and r <= qr) {
      modAdd(a, qa);
      modAdd(sum, calc(qa));
    } else {
      push();
      if (ql < m) ch[0]->add(ql, qr, qa);
      if (m < qr) {
        if (ql < m)
          ch[1]->add(m, qr, qa * powM(x, m - ql) % MOD);
        else
          ch[1]->add(ql, qr, qa);
      }
      pull();
    }
  }
  int query(int ql, int qr) {
    if (ql <= l and r <= qr) return sum;
    int ans = 0;
    push();
    if (ql < m) modAdd(ans, ch[0]->query(ql, qr));
    if (m < qr) modAdd(ans, ch[1]->query(ql, qr));
    pull();
    return ans;
  }
};
class Solution {
  Seg* pT;
  Seg* qT;
  int n, m;
  vector<long long> pre;
  const int phi = 691504013;
  const int sai = 308495997;

 public:
  void run(istream& in, ostream& out) {
    in >> n >> m;
    for (int i = 1; i <= n; ++i) {
      phiTable[i] = 1ll * phiTable[i - 1] * phi % MOD;
      saiTable[i] = 1ll * saiTable[i - 1] * sai % MOD;
    }
    pT = new Seg(0, n, phi);
    qT = new Seg(0, n, sai);
    pre.resize(n + 1);
    for (int i = 0; i < n; ++i) in >> pre[i + 1], (pre[i + 1] += pre[i]) %= MOD;
    while (m--) {
      int t, l, r;
      in >> t >> l >> r;
      --l;
      if (t == 1) {
        pT->add(l, r, phi);
        qT->add(l, r, sai);
      } else {
        auto fiboPart = (0ll + pT->query(l, r) - qT->query(l, r)) * isq5 % MOD;
        auto add = (MOD + pre[r] - pre[l]) % MOD;
        out << (fiboPart + add + MOD) % MOD << '\n';
      }
    }
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  Solution().run(cin, cout);
}
