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 a[300005];
long long ls[4 * 300005], rs[4 * 300005], b[4 * 300005], c[4 * 300005],
    num[4 * 300005], sum[4 * 300005], lb[4 * 300005], lc[4 * 300005];
long long mat[2][2][300005], tot[2][2][300005];
void pre() {
  mat[0][0][0] = 1;
  mat[1][1][0] = 1;
  tot[0][0][0] = 1;
  tot[1][1][0] = 1;
  for (int i = (1); i <= (300005 - 1); i++) {
    mat[0][0][i] = (mat[0][0][i - 1] + mat[0][1][i - 1]) % 1000000009;
    mat[0][1][i] = mat[0][0][i - 1];
    mat[1][0][i] = (mat[1][0][i - 1] + mat[1][1][i - 1]) % 1000000009;
    mat[1][1][i] = mat[1][0][i - 1];
    for (int j = (0); j <= (1); j++) {
      for (int k = (0); k <= (1); k++) {
        tot[j][k][i] = (tot[j][k][i - 1] + mat[j][k][i]) % 1000000009;
      }
    }
  }
}
long long mul(long long x, long long y, long long w) {
  if (w == 1) return x;
  if (w == 2) return y;
  return ((mat[0][0][w - 2] * y) % 1000000009 +
          (mat[0][1][w - 2] * x) % 1000000009) %
         1000000009;
}
long long add(long long x, long long y, long long w) {
  return ((tot[1][0][w - 1] * y) % 1000000009 +
          (tot[1][1][w - 1] * x) % 1000000009) %
         1000000009;
}
void push_up(int rt) {
  num[rt] = (num[rt << 1] + num[rt << 1 | 1]) % 1000000009;
  sum[rt] = (sum[rt << 1] + sum[rt << 1 | 1]) % 1000000009;
}
void push_down(int rt) {
  if (lb[rt] != -1) {
    long long tlb = mul(lb[rt], lc[rt], rs[rt << 1] - ls[rt << 1] + 2);
    long long tlc = mul(lb[rt], lc[rt], rs[rt << 1] - ls[rt << 1] + 3);
    sum[rt << 1] =
        (sum[rt << 1] + add(lb[rt], lc[rt], rs[rt << 1] - ls[rt << 1] + 1)) %
        1000000009;
    sum[rt << 1 | 1] = (sum[rt << 1 | 1] +
                        add(tlb, tlc, rs[rt << 1 | 1] - ls[rt << 1 | 1] + 1)) %
                       1000000009;
    lb[rt << 1] = (lb[rt << 1] + lb[rt]) % 1000000009;
    lc[rt << 1] = (lc[rt << 1] + lc[rt]) % 1000000009;
    lb[rt << 1 | 1] = (lb[rt << 1 | 1] + tlb) % 1000000009;
    lc[rt << 1 | 1] = (lc[rt << 1 | 1] + tlc) % 1000000009;
    lb[rt] = lc[rt] = 0;
  }
}
void build(int l, int r, int rt) {
  ls[rt] = l;
  rs[rt] = r;
  lb[rt] = lc[rt] = 0;
  if (l == r) {
    num[rt] = a[l];
    sum[rt] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
  push_up(rt);
}
void update(int l, int r, int rt, int L, int R, int id) {
  if (L <= l && R >= r) {
    long long p1 = mul(1, 1, id);
    long long p2 = mul(1, 1, id + 1);
    sum[rt] = (sum[rt] + add(p1, p2, r - l + 1)) % 1000000009;
    lb[rt] = (lb[rt] + p1) % 1000000009;
    lc[rt] = (lc[rt] + p2) % 1000000009;
    return;
  }
  push_down(rt);
  int mid = (l + r) >> 1;
  if (L <= mid) update(l, mid, rt << 1, L, min(mid, R), id);
  if (R > mid)
    update(mid + 1, r, rt << 1 | 1, max(mid + 1, L), R,
           id + max(mid - L + 1, 0));
  push_up(rt);
}
long long query(int l, int r, int rt, int L, int R) {
  if (L <= l && R >= r) return (num[rt] + sum[rt]) % 1000000009;
  push_down(rt);
  int mid = (l + r) >> 1;
  long long ret = 0;
  if (L <= mid)
    ret = (ret + query(l, mid, rt << 1, L, min(mid, R))) % 1000000009;
  if (R > mid)
    ret =
        (ret + query(mid + 1, r, rt << 1 | 1, max(mid + 1, L), R)) % 1000000009;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  pre();
  int n, m, k, p;
  while (cin >> n >> m) {
    for (int i = (1); i <= (n); i++) cin >> a[i];
    build(1, n, 1);
    for (int i = (1); i <= (m); i++) {
      int x, y, z;
      cin >> x >> y >> z;
      if (x == 1)
        update(1, n, 1, y, z, 1);
      else
        cout << query(1, n, 1, y, z) << endl;
    }
  }
  return 0;
}
