#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const double pi = acos(-1);
const int MOD = 1e9 + 9;
const int INF = 1e9 + 9;
const int MAXN = 2e6 + 5;
const double eps = 1e-9;
using namespace std;
long long pw1[MAXN], pw2[MAXN], g[MAXN], f[MAXN];
long long a[MAXN];
struct Node {
  long long sum, p1, p2;
} tree[MAXN];
void build(int l, int r, int k) {
  if (l == r) {
    tree[k] = {0, 0, 0};
    return;
  }
  int m = (l + r) >> 1;
  build(l, m, k << 1), build(m + 1, r, k << 1 | 1);
  tree[k].sum = tree[k << 1].sum + tree[k << 1 | 1].sum;
}
void prop(int k, int l, int r) {
  if (tree[k].p1 && l != r) {
    tree[k << 1].p1 = (tree[k << 1].p1 + tree[k].p1) % MOD;
    tree[k << 1].sum =
        (tree[k << 1].sum + tree[k].p1 * f[(l + r) / 2 - l + 1] % MOD) % MOD;
    tree[k << 1 | 1].p1 =
        (tree[k << 1 | 1].p1 + tree[k].p1 * pw1[(l + r) / 2 - l + 1] % MOD) %
        MOD;
    tree[k << 1 | 1].sum =
        (tree[k << 1 | 1].sum + (tree[k].p1 * pw1[(l + r) / 2 - l + 1] % MOD) *
                                    f[r - (l + r) / 2] % MOD) %
        MOD;
    tree[k].p1 = 0;
  }
  if (tree[k].p2 && l != r) {
    tree[k << 1].p2 = (tree[k << 1].p2 + tree[k].p2) % MOD;
    tree[k << 1].sum =
        (tree[k << 1].sum + MOD - tree[k].p2 * g[(l + r) / 2 - l + 1] % MOD) %
        MOD;
    tree[k << 1 | 1].p2 =
        (tree[k << 1 | 1].p2 + tree[k].p2 * pw2[(l + r) / 2 - l + 1] % MOD) %
        MOD;
    tree[k << 1 | 1].sum = (tree[k << 1 | 1].sum + MOD -
                            (tree[k].p2 * pw2[(l + r) / 2 - l + 1] % MOD) *
                                g[r - (l + r) / 2] % MOD) %
                           MOD;
    tree[k].p2 = 0;
  }
}
void upd(int l, int r, int k, int a, int b) {
  prop(k, l, r);
  if (r < a || b < l) return;
  if (a <= l && r <= b) {
    tree[k].p1 = (tree[k].p1 + pw1[l - a + 1]) % MOD;
    tree[k].sum = (tree[k].sum + pw1[l - a + 1] * f[r - l + 1] % MOD) % MOD;
    tree[k].p2 = (tree[k].p2 + pw2[l - a + 1]) % MOD;
    tree[k].sum =
        (tree[k].sum + MOD - pw2[l - a + 1] * g[r - l + 1] % MOD) % MOD;
    return;
  }
  int m = (l + r) >> 1;
  upd(l, m, k << 1, a, b);
  upd(m + 1, r, k << 1 | 1, a, b);
  tree[k].sum = tree[k << 1].sum + tree[k << 1 | 1].sum;
}
long long qry(int l, int r, int k, int a, int b) {
  prop(k, l, r);
  if (r < a || b < l) return 0;
  if (a <= l && r <= b) return tree[k].sum;
  int m = (l + r) >> 1;
  return (qry(l, m, k << 1, a, b) + qry(m + 1, r, k << 1 | 1, a, b)) % MOD;
}
int main() {
  pw1[0] = pw2[0] = 1;
  for (int i = 1; i < MAXN; i++)
    pw1[i] = pw1[i - 1] * 691504013ll % MOD,
    pw2[i] = pw2[i - 1] * 308495997ll % MOD;
  f[1] = g[1] = 1;
  for (int i = 2; i < MAXN; i++)
    f[i] = (f[i - 1] + pw1[i - 1]) % MOD, g[i] = (g[i - 1] + pw2[i - 1]) % MOD;
  int n, m;
  scanf("%d", &(n)), scanf("%d", &(m));
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &(a[i]));
    a[i] = (a[i] + a[i - 1]) % MOD;
  }
  build(1, n, 1);
  for (int i = 0; i < m; i++) {
    int t, l, r;
    scanf("%d", &(t)), scanf("%d", &(l)), scanf("%d", &(r));
    if (t == 1)
      upd(1, n, 1, l, r);
    else {
      long long ans = qry(1, n, 1, l, r) * 276601605ll % MOD;
      ans = (ans + a[r] - a[l - 1] + MOD) % MOD;
      printf("%I64d\n", (ans));
    }
  }
  return 0;
}

### Prompt

Please create a solution in CPP to the following problem:

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>
#pragma GCC optimize("O3")
const double pi = acos(-1);
const int MOD = 1e9 + 9;
const int INF = 1e9 + 9;
const int MAXN = 2e6 + 5;
const double eps = 1e-9;
using namespace std;
long long pw1[MAXN], pw2[MAXN], g[MAXN], f[MAXN];
long long a[MAXN];
struct Node {
  long long sum, p1, p2;
} tree[MAXN];
void build(int l, int r, int k) {
  if (l == r) {
    tree[k] = {0, 0, 0};
    return;
  }
  int m = (l + r) >> 1;
  build(l, m, k << 1), build(m + 1, r, k << 1 | 1);
  tree[k].sum = tree[k << 1].sum + tree[k << 1 | 1].sum;
}
void prop(int k, int l, int r) {
  if (tree[k].p1 && l != r) {
    tree[k << 1].p1 = (tree[k << 1].p1 + tree[k].p1) % MOD;
    tree[k << 1].sum =
        (tree[k << 1].sum + tree[k].p1 * f[(l + r) / 2 - l + 1] % MOD) % MOD;
    tree[k << 1 | 1].p1 =
        (tree[k << 1 | 1].p1 + tree[k].p1 * pw1[(l + r) / 2 - l + 1] % MOD) %
        MOD;
    tree[k << 1 | 1].sum =
        (tree[k << 1 | 1].sum + (tree[k].p1 * pw1[(l + r) / 2 - l + 1] % MOD) *
                                    f[r - (l + r) / 2] % MOD) %
        MOD;
    tree[k].p1 = 0;
  }
  if (tree[k].p2 && l != r) {
    tree[k << 1].p2 = (tree[k << 1].p2 + tree[k].p2) % MOD;
    tree[k << 1].sum =
        (tree[k << 1].sum + MOD - tree[k].p2 * g[(l + r) / 2 - l + 1] % MOD) %
        MOD;
    tree[k << 1 | 1].p2 =
        (tree[k << 1 | 1].p2 + tree[k].p2 * pw2[(l + r) / 2 - l + 1] % MOD) %
        MOD;
    tree[k << 1 | 1].sum = (tree[k << 1 | 1].sum + MOD -
                            (tree[k].p2 * pw2[(l + r) / 2 - l + 1] % MOD) *
                                g[r - (l + r) / 2] % MOD) %
                           MOD;
    tree[k].p2 = 0;
  }
}
void upd(int l, int r, int k, int a, int b) {
  prop(k, l, r);
  if (r < a || b < l) return;
  if (a <= l && r <= b) {
    tree[k].p1 = (tree[k].p1 + pw1[l - a + 1]) % MOD;
    tree[k].sum = (tree[k].sum + pw1[l - a + 1] * f[r - l + 1] % MOD) % MOD;
    tree[k].p2 = (tree[k].p2 + pw2[l - a + 1]) % MOD;
    tree[k].sum =
        (tree[k].sum + MOD - pw2[l - a + 1] * g[r - l + 1] % MOD) % MOD;
    return;
  }
  int m = (l + r) >> 1;
  upd(l, m, k << 1, a, b);
  upd(m + 1, r, k << 1 | 1, a, b);
  tree[k].sum = tree[k << 1].sum + tree[k << 1 | 1].sum;
}
long long qry(int l, int r, int k, int a, int b) {
  prop(k, l, r);
  if (r < a || b < l) return 0;
  if (a <= l && r <= b) return tree[k].sum;
  int m = (l + r) >> 1;
  return (qry(l, m, k << 1, a, b) + qry(m + 1, r, k << 1 | 1, a, b)) % MOD;
}
int main() {
  pw1[0] = pw2[0] = 1;
  for (int i = 1; i < MAXN; i++)
    pw1[i] = pw1[i - 1] * 691504013ll % MOD,
    pw2[i] = pw2[i - 1] * 308495997ll % MOD;
  f[1] = g[1] = 1;
  for (int i = 2; i < MAXN; i++)
    f[i] = (f[i - 1] + pw1[i - 1]) % MOD, g[i] = (g[i - 1] + pw2[i - 1]) % MOD;
  int n, m;
  scanf("%d", &(n)), scanf("%d", &(m));
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &(a[i]));
    a[i] = (a[i] + a[i - 1]) % MOD;
  }
  build(1, n, 1);
  for (int i = 0; i < m; i++) {
    int t, l, r;
    scanf("%d", &(t)), scanf("%d", &(l)), scanf("%d", &(r));
    if (t == 1)
      upd(1, n, 1, l, r);
    else {
      long long ans = qry(1, n, 1, l, r) * 276601605ll % MOD;
      ans = (ans + a[r] - a[l - 1] + MOD) % MOD;
      printf("%I64d\n", (ans));
    }
  }
  return 0;
}

```