#include <bits/stdc++.h>
using namespace std;
const long long sz = 1e6 + 5, mod = 1e9 + 9;
long long t, n, m, k, q;
long long dx[] = {1, 0, -1, 0};
long long dy[] = {0, 1, 0, -1};
long long seg[4 * sz], v[sz], fib[sz];
pair<long long, long long> lazy[4 * sz];
void Build(long long node, long long i, long long f) {
  if (i == f) {
    seg[node] = v[i];
    return;
  }
  long long m = (i + f) / 2;
  Build(2 * node, i, m);
  Build(2 * node + 1, m + 1, f);
  seg[node] = seg[2 * node] + seg[2 * node + 1];
  seg[node] %= mod;
  return;
}
void push(long long node, long long l, long long r) {
  long long a = lazy[node].first;
  long long b = lazy[node].second;
  lazy[node] = {0, 0};
  long long n = r - l + 1;
  n += 2;
  seg[node] += (fib[n - 2] * a + fib[n - 1] * b) % mod - b;
  seg[node] += mod;
  seg[node] %= mod;
  if (l != r) {
    lazy[node * 2].first += a;
    lazy[node * 2].second += b;
    long long m = (l + r) / 2 + 1;
    m -= l - 1;
    lazy[node * 2 + 1].first += (a * fib[m - 2] + b * fib[m - 1]) % mod;
    lazy[node * 2 + 1].second += (a * fib[m - 1] + b * fib[m]) % mod;
    lazy[node * 2].first %= mod;
    lazy[node * 2].second %= mod;
    lazy[node * 2 + 1].first %= mod;
    lazy[node * 2 + 1].second %= mod;
  }
  return;
}
void Update(long long node, long long i, long long f, long long l,
            long long r) {
  push(node, i, f);
  if (l > f || r < i) return;
  if (i >= l && f <= r) {
    long long st = i - l + 1;
    lazy[node].second += fib[st + 1];
    lazy[node].first += fib[st];
    lazy[node].first %= mod;
    lazy[node].second %= mod;
    push(node, i, f);
    return;
  }
  long long m = (i + f) / 2;
  Update(2 * node, i, m, l, r);
  Update(2 * node + 1, m + 1, f, l, r);
  seg[node] = (seg[2 * node] + seg[2 * node + 1]) % mod;
  return;
}
long long Query(long long node, long long i, long long f, long long l,
                long long r) {
  push(node, i, f);
  if (l > f || r < i) return 0;
  if (i >= l && f <= r) return seg[node];
  long long m = (i + f) / 2;
  return (Query(2 * node, i, m, l, r) + Query(2 * node + 1, m + 1, f, l, r)) %
         mod;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  t = 1;
  while (t--) {
    fib[0] = 0, fib[1] = 1, fib[2] = 1;
    for (long long i = 3; i < sz; i++) fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
    cin >> n >> m;
    for (long long i = 1; i <= n; i++) cin >> v[i];
    Build(1, 1, n);
    while (m--) {
      long long type, l, r;
      cin >> type >> l >> r;
      if (type == 1)
        Update(1, 1, n, l, r);
      else
        cout << Query(1, 1, n, l, r) << "\n";
    }
  }
  return 0;
}

### Prompt

Please provide a cpp coded solution to the problem described below:

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.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long sz = 1e6 + 5, mod = 1e9 + 9;
long long t, n, m, k, q;
long long dx[] = {1, 0, -1, 0};
long long dy[] = {0, 1, 0, -1};
long long seg[4 * sz], v[sz], fib[sz];
pair<long long, long long> lazy[4 * sz];
void Build(long long node, long long i, long long f) {
  if (i == f) {
    seg[node] = v[i];
    return;
  }
  long long m = (i + f) / 2;
  Build(2 * node, i, m);
  Build(2 * node + 1, m + 1, f);
  seg[node] = seg[2 * node] + seg[2 * node + 1];
  seg[node] %= mod;
  return;
}
void push(long long node, long long l, long long r) {
  long long a = lazy[node].first;
  long long b = lazy[node].second;
  lazy[node] = {0, 0};
  long long n = r - l + 1;
  n += 2;
  seg[node] += (fib[n - 2] * a + fib[n - 1] * b) % mod - b;
  seg[node] += mod;
  seg[node] %= mod;
  if (l != r) {
    lazy[node * 2].first += a;
    lazy[node * 2].second += b;
    long long m = (l + r) / 2 + 1;
    m -= l - 1;
    lazy[node * 2 + 1].first += (a * fib[m - 2] + b * fib[m - 1]) % mod;
    lazy[node * 2 + 1].second += (a * fib[m - 1] + b * fib[m]) % mod;
    lazy[node * 2].first %= mod;
    lazy[node * 2].second %= mod;
    lazy[node * 2 + 1].first %= mod;
    lazy[node * 2 + 1].second %= mod;
  }
  return;
}
void Update(long long node, long long i, long long f, long long l,
            long long r) {
  push(node, i, f);
  if (l > f || r < i) return;
  if (i >= l && f <= r) {
    long long st = i - l + 1;
    lazy[node].second += fib[st + 1];
    lazy[node].first += fib[st];
    lazy[node].first %= mod;
    lazy[node].second %= mod;
    push(node, i, f);
    return;
  }
  long long m = (i + f) / 2;
  Update(2 * node, i, m, l, r);
  Update(2 * node + 1, m + 1, f, l, r);
  seg[node] = (seg[2 * node] + seg[2 * node + 1]) % mod;
  return;
}
long long Query(long long node, long long i, long long f, long long l,
                long long r) {
  push(node, i, f);
  if (l > f || r < i) return 0;
  if (i >= l && f <= r) return seg[node];
  long long m = (i + f) / 2;
  return (Query(2 * node, i, m, l, r) + Query(2 * node + 1, m + 1, f, l, r)) %
         mod;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  t = 1;
  while (t--) {
    fib[0] = 0, fib[1] = 1, fib[2] = 1;
    for (long long i = 3; i < sz; i++) fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
    cin >> n >> m;
    for (long long i = 1; i <= n; i++) cin >> v[i];
    Build(1, 1, n);
    while (m--) {
      long long type, l, r;
      cin >> type >> l >> r;
      if (type == 1)
        Update(1, 1, n, l, r);
      else
        cout << Query(1, 1, n, l, r) << "\n";
    }
  }
  return 0;
}

```