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 N, Q, op, l, r, sol;
long long A[300100], AS[300100];
long long plo[300100], phi[300100], vlo, vhi, dlo, dhi, coef, sqrt5 = 383008016;
long long b[300100 * 4], e[300100 * 4], len[300100 * 4];
long long lo[300100 * 4], hi[300100 * 4], clo, chi;
long long tree[300100 * 4];
void inc(long long& x, long long y) {
  x += y;
  while (x < 0) x += 1000000009;
  while (x >= 1000000009) x -= 1000000009;
}
long long mpow(long long a, long long b) {
  long long ret = 1;
  while (b > 0) {
    if (b & 1) ret = (ret * a) % 1000000009;
    a = (a * a) % 1000000009;
    b /= 2;
  }
  return ret;
}
long long iv(long long a) { return mpow(a, 1000000009 - 2); };
void init(long long n, long long beg, long long end) {
  b[n] = beg;
  e[n] = end;
  len[n] = end - beg + 1;
  if (beg == end) return;
  long long m = beg + (end - beg) / 2;
  init(2 * n, beg, m);
  init(2 * n + 1, m + 1, end);
}
long long cum_fibo(long long chi, long long clo, long long n) {
  long long ret = 0;
  long long sh = ((((1 - phi[n]) * dhi) % 1000000009) * chi) % 1000000009;
  long long sl = ((((1 - plo[n]) * dlo) % 1000000009) * clo) % 1000000009;
  inc(ret, ((sh - sl) * coef) % 1000000009);
  return ret;
}
void push(long long n) {
  long long le = 2 * n;
  long long ri = 2 * n + 1;
  inc(lo[le], lo[n]);
  inc(hi[le], hi[n]);
  inc(tree[le], cum_fibo(hi[n], lo[n], len[le]));
  long long nlo = (lo[n] * plo[len[le]]) % 1000000009;
  long long nhi = (hi[n] * phi[len[le]]) % 1000000009;
  inc(lo[ri], nlo);
  inc(hi[ri], nhi);
  inc(tree[ri], cum_fibo(nhi, nlo, len[ri]));
  lo[n] = hi[n] = 0;
}
void pull(long long n) {
  tree[n] = 0;
  inc(tree[n], tree[2 * n] + tree[2 * n + 1]);
}
void update(long long n) {
  if (l > e[n] || r < b[n]) return;
  if (l <= b[n] && r >= e[n]) {
    clo = plo[b[n] - l + 1];
    chi = phi[b[n] - l + 1];
    inc(lo[n], clo);
    inc(hi[n], chi);
    inc(tree[n], cum_fibo(chi, clo, len[n]));
    return;
  }
  push(n);
  update(2 * n);
  update(2 * n + 1);
  pull(n);
}
void query(long long n) {
  if (l > e[n] || r < b[n]) return;
  if (l <= b[n] && r >= e[n]) {
    inc(sol, tree[n]);
    return;
  }
  push(n);
  query(2 * n);
  query(2 * n + 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  inc(vhi, (iv(2) * (1 + sqrt5)) % 1000000009);
  inc(vlo, (iv(2) * (1 - sqrt5)) % 1000000009);
  inc(dhi, iv(1 - vhi));
  inc(dlo, iv(1 - vlo));
  inc(coef, (iv(5) * sqrt5) % 1000000009);
  plo[0] = phi[0] = 1;
  for (int I = 1; I < 300100; I++) {
    inc(plo[I], (plo[I - 1] * vlo) % 1000000009);
    inc(phi[I], (phi[I - 1] * vhi) % 1000000009);
  }
  cin >> N >> Q;
  for (long long I = 1; I <= N; I++) {
    cin >> A[I];
    inc(AS[I], AS[I - 1] + A[I]);
  }
  init(1, 1, N);
  while (Q--) {
    cin >> op >> l >> r;
    if (op == 1) {
      update(1);
    } else {
      sol = 0;
      inc(sol, AS[r] - AS[l - 1]);
      query(1);
      cout << sol << "\n";
    }
  }
}
