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 long long int N = 3e5 + 5;
const long long int M = 1e9 + 9;
pair<long long int, long long int> lz[4 * N];
vector<long long int> st1(4 * N);
vector<long long int> ip(N);
vector<long long int> fib(N);
struct matrix {
  long long int a, b, c, d;
};
matrix m1[N];
void inti() {
  m1[1].a = m1[1].b = m1[1].c = 1;
  m1[1].d = 0;
  fib[1] = fib[2] = 1;
  for (long long int i = 3; i < N; i++)
    fib[i] = (fib[i - 1] % M + fib[i - 2] % M) % M;
  for (long long int i = 2; i < N; i++) {
    m1[i].a = ((m1[i - 1].a % M * m1[1].a % M) % M +
               (m1[i - 1].b % M * m1[1].c % M) % M) %
              M;
    m1[i].b = ((m1[i - 1].a % M * m1[1].b % M) % M +
               (m1[i - 1].b % M * m1[1].d % M) % M) %
              M;
    m1[i].c = ((m1[i - 1].c % M * m1[1].a % M) % M +
               (m1[i - 1].d % M * m1[1].c % M) % M) %
              M;
    m1[i].d = ((m1[i - 1].c % M * m1[1].b % M) % M +
               (m1[i - 1].d % M * m1[1].d % M) % M) %
              M;
  }
  return;
}
long long int n, q;
long long int nth_term(long long int ft, long long int st, long long int nt) {
  return ((st % M * m1[nt].a % M) % M + (ft % M * m1[nt].c % M) % M) % M;
}
void prop(long long int l, long long int h, long long int p) {
  long long int t = (h - l + 1);
  if (t == 1)
    st1[p] = (st1[p] % M + lz[p].first % M) % M;
  else if (t == 2) {
    lz[2 * p + 1].first = (lz[2 * p + 1].first % M + lz[p].first % M) % M;
    lz[2 * p + 1].second = (lz[2 * p + 1].second % M + lz[p].first % M) % M;
    lz[2 * p + 2].first = (lz[2 * p + 2].first % M + lz[p].second % M) % M;
    lz[2 * p + 2].second = (lz[2 * p + 2].second % M + lz[p].second % M) % M;
    st1[p] = ((st1[p] % M + lz[p].first % M) % M + lz[p].second % M) % M;
  } else {
    lz[2 * p + 1].first = (lz[2 * p + 1].first % M + lz[p].first % M) % M;
    lz[2 * p + 1].second = (lz[2 * p + 1].second % M + lz[p].second % M) % M;
    long long int a = nth_term(lz[p].first, lz[p].second, t / 2 - 1 + (t % 2));
    long long int b = nth_term(lz[p].first, lz[p].second, t / 2 + (t % 2));
    lz[2 * p + 2].first = (lz[2 * p + 2].first % M + a % M) % M;
    lz[2 * p + 2].second = (lz[2 * p + 2].second % M + b % M) % M;
    long long int x = nth_term(lz[p].first, lz[p].second, t);
    x = ((x % M - lz[p].second % M) % M + M) % M;
    st1[p] = (st1[p] % M + x % M) % M;
  }
  lz[p].first = lz[p].second = 0;
  return;
}
long long int query1(long long int l, long long int h, long long int ql,
                     long long int qh, long long int p) {
  if (lz[p].first != 0 && lz[p].second != 0) prop(l, h, p);
  if (l > qh || h < ql) return 0;
  if (l >= ql && h <= qh) return st1[p] % M;
  long long int m = (l + h) >> 1;
  long long int p1 = query1(l, m, ql, qh, 2 * p + 1);
  long long int p2 = query1(m + 1, h, ql, qh, 2 * p + 2);
  return (p1 % M + p2 % M) % M;
}
void update(long long int l, long long int h, long long int ql,
            long long int qh, long long int p) {
  if (lz[p].first != 0 && lz[p].second != 0) prop(l, h, p);
  if (l > qh || h < ql)
    return;
  else if (l >= ql && h <= qh) {
    lz[p].first = (lz[p].first % M + fib[l - ql + 1] % M) % M;
    lz[p].second = (lz[p].second % M + fib[l - ql + 2] % M) % M;
    prop(l, h, p);
    return;
  }
  long long int m = (l + h) >> 1;
  update(l, m, ql, qh, 2 * p + 1);
  update(m + 1, h, ql, qh, 2 * p + 2);
  st1[p] = (st1[2 * p + 1] % M + st1[2 * p + 2] % M) % M;
  return;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  inti();
  memset((lz), (0), sizeof((lz)));
  scanf("%llu %llu", &n, &q);
  for (long long int i = 0; i < n; i++) {
    scanf("%llu", &ip[i]);
    if (i != 0) ip[i] = (ip[i] % M + ip[i - 1] % M) % M;
  }
  fill(st1.begin(), st1.end(), 0);
  while (q--) {
    long long int s, l, h;
    scanf("%llu%llu%llu", &s, &l, &h);
    l--, h--;
    if (s == 1)
      update(0, n - 1, l, h, 0);
    else {
      long long int x = ip[h];
      if (l != 0) x = (x % M - ip[l - 1] % M + M) % M;
      printf("%llu\n", (x % M + query1(0, n - 1, l, h, 0) % M) % M);
    }
  }
  return 0;
}
