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 inf = 2000000000;
static inline int Rint() {
  struct X {
    int dig[256];
    X() {
      for (int i = '0'; i <= '9'; ++i) dig[i] = 1;
      dig['-'] = 1;
    }
  };
  static X fuck;
  int s = 1, v = 0, c;
  for (; !fuck.dig[c = getchar()];)
    ;
  if (c == '-')
    s = 0;
  else if (fuck.dig[c])
    v = c ^ 48;
  for (; fuck.dig[c = getchar()]; v = v * 10 + (c ^ 48))
    ;
  return s ? v : -v;
}
template <typename T>
static inline void cmax(T& a, const T& b) {
  if (b > a) a = b;
}
template <typename T>
static inline void cmin(T& a, const T& b) {
  if (b < a) a = b;
}
const int maxn = 301005;
int n, m;
int data[maxn];
const int mod = 1000000009;
long long tree[maxn << 2];
long long flag[maxn << 2][2];
int fib[maxn][2];
int fibs[maxn][2];
void init_fib() {
  fib[1][0] = 1;
  fib[2][1] = 1;
  for (int i = 3; i < maxn; ++i) {
    fib[i][0] = (fib[i - 1][0] + fib[i - 2][0]) % mod;
    fib[i][1] = (fib[i - 1][1] + fib[i - 2][1]) % mod;
  }
  fibs[1][0] = 1;
  fibs[1][1] = 0;
  for (int i = 2; i < maxn; ++i) {
    fibs[i][0] = (fibs[i - 1][0] + fib[i][0]) % mod;
    fibs[i][1] = (fibs[i - 1][1] + fib[i][1]) % mod;
  }
}
static inline long long fib_at(long long a, long long b, int id) {
  return (fib[id][0] * a % mod + fib[id][1] * b % mod) % mod;
}
static inline long long fibs_at(long long a, long long b, int id) {
  return (fibs[id][0] * a % mod + fibs[id][1] * b % mod) % mod;
}
void init(int root, int l, int r) {
  if (l == r) {
    tree[root] = data[l];
    flag[root][0] = flag[root][1] = 0;
    return;
  }
  const int lc = root << 1, rc = lc + 1, mid = l + r >> 1;
  init(lc, l, mid);
  init(rc, mid + 1, r);
  tree[root] = (tree[lc] + tree[rc]) % mod;
}
void update(int root, int l, int r, int a, int b, int u, int v) {
  if (l == a && r == b) {
    tree[root] = (tree[root] + fibs_at(u, v, b - a + 1)) % mod;
    flag[root][0] = (flag[root][0] + u) % mod;
    flag[root][1] = (flag[root][1] + v) % mod;
    return;
  }
  const int lc = root << 1, rc = lc + 1, mid = l + r >> 1;
  if (flag[root][0] || flag[root][1]) {
    flag[lc][0] = (flag[lc][0] + flag[root][0]) % mod;
    flag[lc][1] = (flag[lc][1] + flag[root][1]) % mod;
    tree[lc] =
        (tree[lc] + fibs_at(flag[root][0], flag[root][1], mid - l + 1)) % mod;
    long long a = fib_at(flag[root][0], flag[root][1], mid + 2 - l);
    long long b = fib_at(flag[root][0], flag[root][1], mid + 3 - l);
    flag[rc][0] = (flag[rc][0] + a) % mod;
    flag[rc][1] = (flag[rc][1] + b) % mod;
    tree[rc] = (tree[rc] + fibs_at(a, b, r - mid)) % mod;
    flag[root][0] = flag[root][1] = 0;
  }
  if (b <= mid)
    update(lc, l, mid, a, b, u, v);
  else if (a > mid)
    update(rc, mid + 1, r, a, b, u, v);
  else {
    update(lc, l, mid, a, mid, u, v);
    update(rc, mid + 1, r, mid + 1, b, fib_at(u, v, mid + 2 - a),
           fib_at(u, v, mid + 3 - a));
  }
  tree[root] = (tree[lc] + tree[rc]) % mod;
}
long long query(int root, int l, int r, int a, int b) {
  if (l == a && r == b) {
    return tree[root];
  }
  const int lc = root << 1, rc = lc + 1, mid = l + r >> 1;
  if (flag[root][0] || flag[root][1]) {
    flag[lc][0] = (flag[lc][0] + flag[root][0]) % mod;
    flag[lc][1] = (flag[lc][1] + flag[root][1]) % mod;
    tree[lc] =
        (tree[lc] + fibs_at(flag[root][0], flag[root][1], mid - l + 1)) % mod;
    long long a = fib_at(flag[root][0], flag[root][1], mid + 2 - l);
    long long b = fib_at(flag[root][0], flag[root][1], mid + 3 - l);
    flag[rc][0] = (flag[rc][0] + a) % mod;
    flag[rc][1] = (flag[rc][1] + b) % mod;
    tree[rc] = (tree[rc] + fibs_at(a, b, r - mid)) % mod;
    flag[root][0] = flag[root][1] = 0;
  }
  if (b <= mid)
    return query(lc, l, mid, a, b);
  else if (a > mid)
    return query(rc, mid + 1, r, a, b);
  else {
    long long s0 = query(lc, l, mid, a, mid);
    long long s1 = query(rc, mid + 1, r, mid + 1, b);
    return (s0 + s1) % mod;
  }
}
int main() {
  init_fib();
  n = Rint(), m = Rint();
  for (int i = 1; i <= n; ++i) data[i] = Rint();
  init(1, 1, n);
  while (m--) {
    int cmd = Rint(), l = Rint(), r = Rint();
    if (cmd == 1) {
      update(1, 1, n, l, r, 1, 1);
    } else {
      printf("%I64d\n", query(1, 1, n, l, r));
    }
  }
  return 0;
}
