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;
pair<long long, long long> save_in[300007];
struct str {
  long long a, b, c, d, flag;
  str() { flag = 0; }
};
str dp[300007];
str mul(str a, str b) {
  str st;
  long long a1 =
      ((a.a * b.a) % 1000000009 + (a.b * b.c) % 1000000009) % 1000000009;
  long long b1 =
      ((a.a * b.b) % 1000000009 + (a.b * b.d) % 1000000009) % 1000000009;
  long long c1 =
      ((a.c * b.a) % 1000000009 + (a.d * b.c) % 1000000009) % 1000000009;
  long long d1 =
      ((a.c * b.b) % 1000000009 + (a.d * b.d) % 1000000009) % 1000000009;
  st.a = a1;
  st.b = b1;
  st.c = c1;
  st.d = d1;
  return st;
}
str base, res;
str power(long long k) {
  if (k == 1) return base;
  if (dp[k].flag == 1) return dp[k];
  str x = power(k / 2);
  x = mul(x, x);
  x = (k % 2) ? mul(x, base) : x;
  dp[k] = x;
  dp[k].flag = 1;
  return dp[k];
}
void power_cal() {
  long long i, a, b;
  dp[1] = base;
  for (i = 3; i <= 300007 - 4; i++) {
    res = power(i - 2);
  }
}
long long fib(long long n, long long first = 1, long long second = 1) {
  if (n == 1) return first;
  if (n == 2) return second;
  n -= 2;
  long long ans =
      ((dp[n].a * second) % 1000000009 + (dp[n].b * first) % 1000000009) %
      1000000009;
  return ans % 1000000009;
}
long long mod_number(long long num, long long mod = 1000000009) {
  return (num % mod + mod) % mod;
}
long long tree[4 * 300007], in[300007];
pair<long long, long long> lzy[4 * 300007];
pair<long long, long long> combine(pair<long long, long long> a,
                                   pair<long long, long long> b) {
  return {(a.first + b.first) % 1000000009, (a.second + b.second) % 1000000009};
}
void build(long long node, long long l, long long r) {
  lzy[node] = {0, 0};
  if (l == r) {
    tree[node] = in[l] % 1000000009;
    return;
  }
  long long mid = (l + r) / 2;
  build(node * 2, l, mid);
  build(node * 2 + 1, mid + 1, r);
  tree[node] = (tree[node * 2] + tree[node * 2 + 1]) % 1000000009;
}
void update_lzy(long long node, long long l, long long r) {
  long long mid = (l + r) / 2, f, s, d, f1, s1, f2, s2, sum_left, sum_right, d2;
  d = mid - l + 1;
  d2 = r - l + 1;
  f = lzy[node].first, s = lzy[node].second;
  f1 = f, s1 = s;
  sum_left = fib(d + 2, f1, s1);
  sum_left = mod_number(sum_left - s1);
  tree[node * 2] = (tree[node * 2] + sum_left) % 1000000009;
  lzy[node * 2] = combine(lzy[node * 2], lzy[node]);
  f2 = fib(d + 1, f, s);
  s2 = fib(d + 2, f, s);
  sum_right = fib(d2 + 2, f, s);
  sum_right = mod_number(sum_right - s1);
  sum_right = mod_number(sum_right - sum_left);
  tree[node * 2 + 1] = (tree[node * 2 + 1] + sum_right) % 1000000009;
  lzy[node * 2 + 1] = combine(lzy[node * 2 + 1], {f2, s2});
  lzy[node] = {0, 0};
}
void update(long long node, long long l, long long r, long long i,
            long long j) {
  if (l > j || r < i) return;
  if (l >= i && r <= j) {
    long long f, s, sum;
    f = fib(l - i + 1);
    s = fib(l - i + 2);
    sum = fib(r - i + 3);
    sum = mod_number(sum - s);
    tree[node] = (tree[node] + sum) % 1000000009;
    lzy[node] = combine(lzy[node], {f, s});
    return;
  }
  if (lzy[node].first > 0 || lzy[node].second > 0) update_lzy(node, l, r);
  long long mid = (l + r) / 2;
  update(node * 2, l, mid, i, j);
  update(node * 2 + 1, mid + 1, r, i, j);
  tree[node] = (tree[node * 2] + tree[node * 2 + 1]) % 1000000009;
}
long long query(long long node, long long l, long long r, long long i,
                long long j) {
  if (l > j || r < i) return 0;
  if (l >= i && r <= j) return tree[node];
  if (lzy[node].first > 0 || lzy[node].second > 0) update_lzy(node, l, r);
  long long mid = (l + r) / 2;
  return (query(node * 2, l, mid, i, j) +
          query(node * 2 + 1, mid + 1, r, i, j)) %
         1000000009;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  base.a = 1;
  base.b = 1;
  base.c = 1;
  base.d = 0;
  power_cal();
  long long n, m, i, l, r, type, ans;
  cin >> n >> m;
  for (i = 0; i < n; i++) cin >> in[i + 1];
  build(1, 1, n);
  for (i = 0; i < m; i++) {
    cin >> type >> l >> r;
    if (type == 1) {
      update(1, 1, n, l, r);
    } else {
      ans = query(1, 1, n, l, r);
      cout << ans << "\n";
    }
  }
  return 0;
}
