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;
long long mod = (long long)1e9 + 9;
struct Matrix {
  long long s[2][2];
  void clear() { memset(s, 0, sizeof(s)); }
};
inline Matrix operator*(Matrix a, Matrix b) {
  Matrix c;
  c.clear();
  for (int i = 0; i <= 1; i++)
    for (int j = 0; j <= 1; j++) {
      for (int k = 0; k <= 1; k++) c.s[i][j] += a.s[i][k] * b.s[k][j];
      c.s[i][j] %= mod;
    }
  return c;
}
inline Matrix operator+(Matrix a, Matrix b) {
  Matrix c;
  c.clear();
  for (int i = 0; i <= 1; i++)
    for (int j = 0; j <= 1; j++) {
      c.s[i][j] = a.s[i][j] + b.s[i][j];
      c.s[i][j] %= mod;
    }
  return c;
}
bool operator!=(Matrix a, Matrix b) {
  for (int i = 0; i <= 1; i++)
    for (int j = 0; j <= 1; j++)
      if (a.s[i][j] != b.s[i][j]) return true;
  return false;
}
struct Tree {
  int left;
  int right;
  long long key;
  Matrix num;
};
Tree t[1200000];
Matrix t0[300001];
Matrix st0[300001];
Matrix fib;
Matrix nul;
long long a[300001], sa[300001];
void maketree(int l, int r, int o) {
  t[o].left = l;
  t[o].right = r;
  t[o].num.clear();
  t[o].key = 0;
  if (l == r) return;
  int mid = (l + r) / 2;
  maketree(l, mid, o * 2);
  maketree(mid + 1, r, o * 2 + 1);
  return;
}
void down(int o) {
  if (t[o].left == t[o].right) {
    t[o].num.clear();
    return;
  }
  Matrix q, u;
  if (t[o].num != nul) {
    u = st0[t[o * 2].right - t[o * 2].left];
    t[o * 2].key +=
        (t[o].num.s[0][0] * u.s[0][0] + t[o].num.s[0][1] * u.s[1][0]) % mod;
    t[o * 2].num = t[o * 2].num + t[o].num;
    q = t[o].num * t0[t[o * 2].right - t[o * 2].left + 1];
    t[o * 2 + 1].num = t[o * 2 + 1].num + q;
    u = st0[t[o * 2 + 1].right - t[o * 2 + 1].left];
    t[o * 2 + 1].key += (q.s[0][0] * u.s[0][0] + q.s[0][1] * u.s[1][0]) % mod;
    t[o].num.clear();
  }
  return;
}
inline long long sum(int l, int r, int o) {
  down(o);
  if (l > t[o].right || r < t[o].left) return 0;
  if (l <= t[o].left && r >= t[o].right) return t[o].key;
  return (sum(l, r, o * 2) + sum(l, r, o * 2 + 1));
}
void add(int l, int r, int o) {
  down(o);
  if (l > t[o].right || r < t[o].left) return;
  if (l <= t[o].left && r >= t[o].right) {
    int len = min(r, t[o].left - 1) - max(l, 1) + 1;
    len = max(len, 0);
    Matrix p = t0[0];
    p = p * t0[len];
    t[o].num = t[o].num + p;
    Matrix u = st0[t[o].right - t[o].left];
    t[o].key += (p.s[0][0] * u.s[0][0] + p.s[0][1] * u.s[1][0]) % mod;
    return;
  }
  add(l, r, o * 2);
  add(l, r, o * 2 + 1);
  t[o].key = t[o * 2].key + t[o * 2 + 1].key;
  return;
}
int main() {
  nul.clear();
  t0[0].s[0][0] = t0[0].s[1][1] = 1;
  t0[0].s[1][0] = t0[0].s[0][1] = 0;
  fib.s[0][0] = fib.s[1][0] = fib.s[0][1] = 1;
  fib.s[1][1] = 0;
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) t0[i] = t0[i - 1] * fib;
  st0[0] = t0[0];
  for (int i = 1; i <= n; i++) st0[i] = st0[i - 1] + t0[i];
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (int i = 1; i <= n; i++) sa[i] = sa[i - 1] + a[i];
  maketree(1, n, 1);
  for (int i = 1; i <= m; i++) {
    int k, l, r;
    scanf("%d%d%d", &k, &l, &r);
    if (k == 1)
      add(l, r, 1);
    else
      printf("%I64d\n", (sum(l, r, 1) + sa[r] - sa[l - 1]) % mod);
  }
  return 0;
}
