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 MAXN = 3e5 + 6.66;
const long long MOD = 1e9 + 9.99;
long long fib[MAXN];
long long arr[MAXN];
void calc_fib() {
  fib[1] = 1;
  for (int i = 2; i < MAXN; i++) fib[i] = (fib[i - 1] + fib[i - 2]) % MOD;
}
long long get_fib(int i, long long k1, long long k2) {
  return (i == 1 ? k1 : (fib[i - 1] * k2 % MOD + fib[i - 2] * k1 % MOD) % MOD);
}
struct segment {
  int idx, l, r;
  long long sum;
  long long k1, k2;
  segment() {
    idx = l = r = -1;
    sum = k1 = k2 = 0;
  }
  segment(int idx, int l) : idx(idx), l(l), r(l + 1) {
    sum = arr[l];
    k1 = k2 = 0;
  }
  segment(int idx, segment s1, segment s2) : idx(idx) {
    if (s1.idx == -1) {
      *this = s2;
      return;
    }
    if (s2.idx == -1) {
      *this = s1;
      return;
    }
    l = s1.l;
    r = s2.r;
    sum = (s1.sum + s2.sum) % MOD;
    k1 = k2 = 0;
  }
  void shift(long long tk1, long long tk2) {
    sum = (sum + (get_fib(r - l + 2, tk1, tk2) - tk2 + MOD) % MOD) % MOD;
    k1 = (k1 + tk1) % MOD;
    k2 = (k2 + tk2) % MOD;
  }
  void rm_shift() { k1 = k2 = 0; }
} seg[MAXN * 4];
void shift(int idx) {
  long long k1 = seg[idx].k1;
  long long k2 = seg[idx].k2;
  if (k1 == 0 && k2 == 0) return;
  int l = seg[idx].l;
  int r = seg[idx].r;
  int mid = l + (r - l) / 2;
  seg[idx * 2].shift(k1, k2);
  seg[idx * 2 + 1].shift(get_fib(mid - l + 1, k1, k2),
                         get_fib(mid - l + 2, k1, k2));
  seg[idx].rm_shift();
}
int intersection(int x, int y, int a, int b) {
  if (a >= y || x >= b) return 0;
  return min(b, y) - max(x, a);
}
void process(int idx, int l, int r) {
  if (l >= r) return;
  if (r - l == 1) {
    seg[idx] = segment(idx, l);
    return;
  }
  int mid = l + (r - l) / 2;
  process(idx * 2, l, mid);
  process(idx * 2 + 1, mid, r);
  seg[idx] = segment(idx, seg[idx * 2], seg[idx * 2 + 1]);
}
void upd(int idx, int b, int e, int st) {
  if (seg[idx].idx == -1) return;
  int l = seg[idx].l;
  int r = seg[idx].r;
  if (l >= e || r <= b) return;
  if (l >= b && r <= e) {
    seg[idx].shift(fib[st], fib[st + 1]);
    return;
  }
  int mid = l + (r - l) / 2;
  shift(idx);
  upd(idx * 2, b, e, st);
  upd(idx * 2 + 1, b, e, st + intersection(l, mid, b, e));
  seg[idx] = segment(idx, seg[idx * 2], seg[idx * 2 + 1]);
}
long long get(int idx, int b, int e) {
  if (seg[idx].idx == -1) return 0;
  int l = seg[idx].l;
  int r = seg[idx].r;
  if (l >= e || r <= b) return 0;
  if (l >= b && r <= e) return seg[idx].sum;
  shift(idx);
  return (get(idx * 2, b, e) + get(idx * 2 + 1, b, e)) % MOD;
}
void traverse(int idx) {
  if (seg[idx].idx == -1) return;
  cout << seg[idx].sum << " " << seg[idx].l << " " << seg[idx].r << endl;
  if (seg[idx].r - seg[idx].l == 1) return;
  shift(idx);
  traverse(idx * 2);
  traverse(idx * 2 + 1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  calc_fib();
  for (int i = 0; i < n; i++) cin >> arr[i];
  process(1, 0, n);
  while (m--) {
    int x, y, z;
    cin >> x >> y >> z;
    if (x == 2)
      cout << get(1, y - 1, z) << endl;
    else
      upd(1, y - 1, z, 1);
  }
  return 0;
}
