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 fib[700000], fsum[700000];
pair<long, long> ad[1 << 20];
long ans[1 << 20];
long n, m;
long s[1 << 20];
long a[1 << 20];
long tp, l, r;
long makefib(long ind, long a, long b) {
  if (ind == 1) return a;
  if (ind == 2) return b;
  return (1ll * fib[ind - 1] * b + 1ll * fib[ind - 2] * a) % 1000000009;
}
void doadd(long v, long l, long r, long a, long b) {
  ad[v].first += a;
  ad[v].second += b;
  ad[v].first %= 1000000009;
  ad[v].second %= 1000000009;
  if (l == r)
    ans[v] = ans[v] + a, ans[v] %= 1000000009;
  else if (l + 1 == r)
    ans[v] = ans[v] + (b + a) % 1000000009, ans[v] %= 1000000009;
  else
    ans[v] =
        (ans[v] + 1ll * fsum[r - l] * b + 1ll * (fsum[r - l - 1] + 1) * a) %
        1000000009;
}
void push(long v, long l, long r) {
  if (l == r) return;
  long m = l + r;
  m /= 2;
  long v1, v2;
  doadd(v * 2, l, m, ad[v].first, ad[v].second);
  long val1, val2;
  val1 = makefib(m - l + 2, ad[v].first, ad[v].second);
  val2 = makefib(m - l + 3, ad[v].first, ad[v].second);
  doadd(v * 2 + 1, m + 1, r, val1, val2);
  ad[v] = make_pair(0, 0);
}
void update(long v, long tl, long tr, long l, long r, long L, long R) {
  if (l > r) return;
  push(v, tl, tr);
  if (l == tl && r == tr) {
    doadd(v, l, r, fib[l - L + 1], fib[l - L + 2]);
    return;
  }
  push(v, tl, tr);
  long sdfjahlfasfh = tl + tr;
  sdfjahlfasfh /= 2;
  update(v * 2, tl, sdfjahlfasfh, l, min(r, sdfjahlfasfh), L, R);
  long aa, bb;
  update(v * 2 + 1, sdfjahlfasfh + 1, tr, max(l, sdfjahlfasfh + 1), r, L, R);
  ans[v] = ans[v * 2] + ans[v * 2 + 1];
  ans[v] %= 1000000009;
}
long sum(long v, long tl, long tr, long l, long r) {
  if (l > r) return 0;
  if (l == tl && r == tr) {
    return ans[v];
  }
  push(v, tl, tr);
  long sdfjahlfasfh = tl + tr;
  sdfjahlfasfh /= 2;
  long res = sum(v * 2, tl, sdfjahlfasfh, l, min(r, sdfjahlfasfh)) +
             sum(v * 2 + 1, sdfjahlfasfh + 1, tr, max(l, sdfjahlfasfh + 1), r);
  return res % 1000000009;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    s[i] = s[i - 1] + a[i];
    s[i] %= 1000000009;
  }
  fib[1] = fib[2] = 1;
  for (int i = 3; i <= 500000; i++) {
    fib[i] = fib[i - 1] + fib[i - 2];
    fib[i] %= 1000000009;
  }
  for (int i = 1; i <= 500000; i++) {
    fsum[i] = fsum[i - 1] + fib[i];
    fsum[i] %= 1000000009;
  }
  for (int i = 0; i < m; i++) {
    cin >> tp >> l >> r;
    if (tp == 1) {
      update(1, 1, n, l, r, l, r);
    } else
      cout << ((sum(1, 1, n, l, r) + s[r] - s[l - 1]) % 1000000009 +
               1000000009) %
                  1000000009
           << endl;
  }
  cin.get();
  cin.get();
  return 0;
}
