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>
#pragma GCC optimize(3)
using namespace std;
namespace Base {
inline char gc(void) {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
template <class T>
inline void read(T &x) {
  T flag = 1;
  x = 0;
  register char ch = gc();
  for (; !isdigit(ch); ch = gc())
    if (ch == '-') flag = -1;
  for (; isdigit(ch); ch = gc()) x = (x << 1) + (x << 3) + (ch & 15);
  x *= flag;
  return;
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  register T y = 1;
  int len = 1;
  for (; y <= x / 10; y *= 10) ++len;
  for (; len; --len, x %= y, y /= 10) putchar(x / y + 48);
}
template <class T>
inline void writeln(T x) {
  write(x);
  puts("");
}
template <class T>
inline void writeln(T x, char c) {
  write(x);
  putchar(c);
}
template <class T>
inline void writeln(char c, T x) {
  putchar(c);
  write(x);
}
template <class T>
inline void chkmax(T &x, const T y) {
  x > y ? x = x : x = y;
}
template <class T>
inline void chkmin(T &x, const T y) {
  x < y ? x = x : x = y;
}
inline void file(string str) {
  freopen((str + ".in").c_str(), "r", stdin);
  freopen((str + ".out").c_str(), "w", stdout);
}
}  // namespace Base
using namespace Base;
const long long mod = 1e9 + 9;
inline long long _mod(const long long val) { return val % mod; }
enum { Maxn = 300005 };
int n, m, opt, x, y;
long long a[Maxn], fib[Maxn], sum[Maxn];
inline void setup_fib(int len) {
  fib[1] = fib[2] = 1ll;
  for (int i = 3; i <= len + 1; i++) fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
}
struct SegmentTree {
  struct Node {
    long long f[3], sum;
  } t[Maxn * 20];
  inline void pushup(int pos, int len) {
    t[pos].f[1] %= mod, t[pos].f[2] %= mod;
    t[pos].sum = ((t[pos << 1].sum + t[pos << 1 | 1].sum) +
                  ((t[pos].f[1] * fib[len]) + (t[pos].f[2] * fib[len + 1]) -
                   t[pos].f[2])) %
                 mod;
  }
  inline void pushdown(int pos, int l, int r) {
    if (t[pos].f[1] == 0 && t[pos].f[2] == 0) return;
    int mid = l + r >> 1;
    t[pos << 1].f[1] += t[pos].f[1],
        t[pos << 1 | 1].f[1] +=
        t[pos].f[1] * fib[mid - l] + t[pos].f[2] * fib[mid - l + 1];
    t[pos << 1].f[2] += t[pos].f[2],
        t[pos << 1 | 1].f[2] +=
        t[pos].f[1] * fib[mid - l + 1] + t[pos].f[2] * fib[mid - l + 2];
    t[pos].f[1] = t[pos].f[2] = 0ll;
    pushup(pos << 1, mid - l + 1), pushup(pos << 1 | 1, r - mid);
  }
  inline void build(int pos, int l, int r) {
    t[pos].f[1] = t[pos].f[2] = t[pos].sum = 0ll;
    if (l == r) {
      t[pos].sum = a[l];
      return;
    }
    int mid = l + r >> 1;
    build(pos << 1, l, mid);
    build(pos << 1 | 1, mid + 1, r);
    pushup(pos, r - l + 1);
  }
  inline void modify(int pos, int l, int r, int L, int R) {
    if (L <= l && r <= R) {
      t[pos].f[1] += fib[l - L + 1];
      t[pos].f[2] += fib[l - L + 2];
      t[pos].f[1] %= mod, t[pos].f[2] %= mod;
      pushup(pos, r - l + 1);
      return;
    }
    pushdown(pos, l, r);
    int mid = l + r >> 1;
    if (L <= mid) modify(pos << 1, l, mid, L, R);
    if (mid < R) modify(pos << 1 | 1, mid + 1, r, L, R);
    pushup(pos, r - l + 1);
  }
  inline long long query(int pos, int l, int r, int L, int R) {
    if (L <= l && r <= R) return t[pos].sum;
    pushdown(pos, l, r);
    long long res = 0ll;
    int mid = l + r >> 1;
    if (L <= mid) res += query(pos << 1, l, mid, L, R);
    res = (res + mod) % mod;
    if (mid < R) res += query(pos << 1 | 1, mid + 1, r, L, R);
    return (res + mod) % mod;
  }
} sgt;
signed main(void) {
  read(n);
  read(m);
  setup_fib(n);
  for (int i = 1; i <= n; i++) read(a[i]), sum[i] = sum[i - 1] + a[i];
  while (m--) {
    read(opt);
    read(x);
    read(y);
    if (opt == 1)
      sgt.modify(1, 1, n, x, y);
    else
      writeln(
          ((sgt.query(1, 1, n, x, y) - sum[x - 1] + sum[y] + mod) % mod + mod) %
          mod);
  }
  return 0;
}
