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 = 300005;
const int MOD = 1e9 + 9;
const int SQRT5 = 383008016;
const int INVSQRT5 = 276601605;
const int P = 691504013;
const int Q = 308495997;
const int INVPMIN1 = 691504013;
const int INVQMIN1 = 308495997;
struct SegmentTree {
  int n;
  int ratio;
  int invers;
  vector<int> sum;
  vector<int> lazy;
  vector<int> pows;
  SegmentTree() {
    n = 0;
    sum.clear();
    lazy.clear();
  }
  SegmentTree(int n, int ratio, int invers) {
    this->ratio = ratio;
    this->invers = invers;
    this->n = n << 2;
    sum.resize(n << 2, 0);
    lazy.resize(n << 2, 0);
    pows.resize(n + 1, 0);
    pows[0] = 1;
    for (int i = 1; i <= n; i++) pows[i] = 1LL * ratio * pows[i - 1] % MOD;
  }
  void propagate(int p, int l, int r) {
    if (lazy[p] == 0) return;
    int left = p << 1;
    int right = left | 1;
    int mid = l + r >> 1;
    update(left, l, mid, l, mid, lazy[p]);
    int tmp = 1LL * lazy[p] * pows[mid - l + 1] % MOD;
    update(right, mid + 1, r, mid + 1, r, tmp);
    lazy[p] = 0;
  }
  void update(int p, int l, int r, int a, int b, int val = -1) {
    if (l > b || r < a) return;
    if (a <= l && r <= b) {
      if (val == -1) val = pows[l - a + 1];
      sum[p] += 1LL * val * (pows[r - l + 1] - 1) % MOD * invers % MOD;
      sum[p] %= MOD;
      lazy[p] += val;
      lazy[p] %= MOD;
      return;
    }
    propagate(p, l, r);
    int mid = l + r >> 1;
    int left = p << 1;
    int right = left | 1;
    update(left, l, mid, a, b);
    update(right, mid + 1, r, a, b);
    sum[p] = (sum[left] + sum[right]) % MOD;
  }
  int query(int p, int l, int r, int a, int b) {
    if (l > b || r < a) return 0;
    if (a <= l && r <= b) return sum[p];
    propagate(p, l, r);
    int mid = l + r >> 1;
    int left = p << 1;
    int right = left | 1;
    return (query(left, l, mid, a, b) + query(right, mid + 1, r, a, b)) % MOD;
  }
};
int n, m;
int a[N];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++)
    scanf("%d", a + i), a[i] += a[i - 1], a[i] %= MOD;
  SegmentTree p(n, P, INVPMIN1);
  SegmentTree q(n, Q, INVQMIN1);
  while (m--) {
    int type, l, r;
    scanf("%d %d %d", &type, &l, &r);
    if (type == 1) {
      p.update(1, 1, n, l, r);
      q.update(1, 1, n, l, r);
    }
    if (type == 2) {
      int res = p.query(1, 1, n, l, r) - q.query(1, 1, n, l, r);
      res = 1LL * res * INVSQRT5 % MOD;
      res += a[r] - a[l - 1];
      while (res < 0) res += MOD;
      while (res >= MOD) res -= MOD;
      printf("%d\n", res);
    }
  }
  return 0;
}
