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;
template <class C>
void min_self(C &a, C b) {
  a = min(a, b);
}
template <class C>
void max_self(C &a, C b) {
  a = max(a, b);
}
const long long MOD = 1000000009;
long long mod(long long n, long long m = MOD) {
  n %= m;
  if (n < 0) n += m;
  return n;
}
const int MAXN = 1e5 + 5;
const int LOGN = 21;
const long long INF = 1e14;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
template <class T1, class T2>
void add(T1 &x, T2 y, long long m = MOD) {
  x += y;
  if (x >= m) x -= m;
}
template <class T1, class T2>
void sub(T1 &x, T2 y, long long m = MOD) {
  x -= y;
  if (x < 0) x += m;
}
vector<int> fib;
int getfib(int A, int B, int n) {
  if (n == 0) return mod(B - A);
  if (n == 1) return A;
  if (n == 2) return B;
  return mod((long long)mod((long long)A * fib[n - 2]) +
             mod((long long)B * fib[n - 1]));
}
struct Node {
  int val;
  Node() : val(0) {}
  Node(int x) : val(x) {}
  static void merge(Node &parent, Node lch, Node rch) {
    parent.val = mod((long long)lch.val + rch.val);
  }
};
struct LazyNode {
  int a, b;
  LazyNode() : a(0), b(0) {}
  LazyNode(int A, int B) : a(A), b(B) {}
  void apply(Node &tree, int l, int r) {
    int n = r - l + 1;
    add(tree.val, mod((long long)getfib(a, b, n + 2) - b));
  }
  void accumulate(LazyNode &other) {
    other.a = mod((long long)other.a + a);
    other.b = mod((long long)other.b + b);
  }
};
template <class T, class LT>
class LazySegmentTree {
 public:
  int N, sz;
  vector<T> tree;
  vector<LT> lazy;
  LazySegmentTree(int n) {
    N = n;
    sz = 4 * N;
    tree.resize(sz, T());
    lazy.resize(sz, LT());
  }
  LazySegmentTree(vector<int> &a) {
    N = a.size();
    sz = 4 * N;
    tree.resize(sz, T());
    lazy.resize(sz, LT());
    build(0, 0, N - 1, a);
  }
  void build(int v, int l, int r, vector<int> &a) {
    if (l == r) {
      tree[v] = Node{a[l]};
      return;
    }
    int m = l + (r - l) / 2;
    build(2 * v + 1, l, m, a);
    build(2 * v + 2, m + 1, r, a);
    Node::merge(tree[v], tree[2 * v + 1], tree[2 * v + 2]);
  }
  void push(int v, int l, int m, int r) {
    lazy[v].apply(tree[2 * v + 1], l, m);
    lazy[v].accumulate(lazy[2 * v + 1]);
    int n = m - l + 1;
    int A = getfib(lazy[v].a, lazy[v].b, n + 1);
    int B = getfib(lazy[v].a, lazy[v].b, n + 2);
    LT{A, B}.apply(tree[2 * v + 2], m + 1, r);
    LT{A, B}.accumulate(lazy[2 * v + 2]);
    lazy[v] = LT();
  }
  void range(int v, int l, int r, int ql, int qr, LT upd) {
    if (qr < l || ql > r) return;
    if (ql <= l && r <= qr) {
      int n = l - ql + 1;
      int A = getfib(upd.a, upd.b, n);
      int B = getfib(upd.a, upd.b, n + 1);
      lazy[v].a = mod((long long)lazy[v].a + A);
      lazy[v].b = mod((long long)lazy[v].b + B);
      LT{A, B}.apply(tree[v], l, r);
      return;
    }
    int m = l + (r - l) / 2;
    push(v, l, m, r);
    range(2 * v + 1, l, m, ql, qr, upd);
    range(2 * v + 2, m + 1, r, ql, qr, upd);
    Node::merge(tree[v], tree[2 * v + 1], tree[2 * v + 2]);
  }
  T query(int v, int l, int r, int ql, int qr) {
    if (qr < l || ql > r) return T();
    if (ql <= l && r <= qr) return tree[v];
    int m = l + (r - l) / 2;
    push(v, l, m, r);
    T current;
    Node::merge(current, query(2 * v + 1, l, m, ql, qr),
                query(2 * v + 2, m + 1, r, ql, qr));
    return current;
  }
  T get(int l, int r) { return query(0, 0, N - 1, l, r); }
  void range_modify(int l, int r, LT val) { range(0, 0, N - 1, l, r, val); }
  void modify(int pos, LT val) { range_modify(pos, pos, val); }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  fib.resize(n + 6, 0);
  fib[1] = fib[2] = 1;
  for (int i = 3; i <= n + 5; i++)
    fib[i] = mod((long long)fib[i - 1] + fib[i - 2]);
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  LazySegmentTree<Node, LazyNode> st(a);
  for (int i = 0; i < m; i++) {
    int type, l, r;
    cin >> type >> l >> r;
    l--, r--;
    if (type == 1) {
      st.range_modify(l, r, {1, 1});
    } else {
      cout << st.get(l, r).val, cout << "\n";
    }
  }
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
