#include <bits/stdc++.h>
using namespace std;
const long long p = 1e9 + 9;
int n, m;
struct data {
  long long va, lazy1, lazy2;
  int l, r;
} t[1200005];
long long a[300005], f[300007];
void build(int i, int l, int r) {
  t[i].l = l;
  t[i].r = r;
  if (l == r) {
    t[i].va = a[l];
    return;
  }
  int mid = (l + r) / 2;
  build(i * 2, l, mid);
  build(i * 2 + 1, mid + 1, r);
  t[i].va = (t[i * 2].va + t[i * 2 + 1].va) % p;
}
void pushdown(int i) {
  if (t[i].l == t[i].r) {
    t[i].va += t[i].lazy1;
    t[i].lazy1 = 0;
    return;
  }
  int len = t[i].r - t[i].l + 1;
  t[i].va += (f[len + 1] - 1) * t[i].lazy2 % p + f[len] * t[i].lazy1 % p;
  t[i].va %= p;
  t[i * 2].lazy1 = (t[i * 2].lazy1 + t[i].lazy1) % p;
  t[i * 2].lazy2 = (t[i * 2].lazy2 + t[i].lazy2) % p;
  int mid = (t[i].r + t[i].l) / 2 + 1;
  t[i * 2 + 1].lazy1 +=
      t[i].lazy1 * f[mid - 1 - t[i].l] % p + t[i].lazy2 * f[mid - t[i].l] % p;
  t[i * 2 + 1].lazy2 +=
      t[i].lazy1 * f[mid - t[i].l] % p + t[i].lazy2 * f[mid - t[i].l + 1] % p;
  t[i * 2 + 1].lazy1 %= p;
  t[i * 2 + 1].lazy2 %= p;
  t[i].lazy1 = t[i].lazy2 = 0;
}
void add(int i, int l, int r) {
  pushdown(i);
  int nowl = t[i].l, nowr = t[i].r;
  if (nowl > r || nowr < l) return;
  if (nowl >= l && nowr <= r) {
    int nowst = nowl - l + 1;
    t[i].lazy1 = (t[i].lazy1 + f[nowst]) % p;
    t[i].lazy2 = (t[i].lazy2 + f[nowst + 1]) % p;
    pushdown(i);
    return;
  }
  add(i * 2, l, r);
  add(i * 2 + 1, l, r);
  t[i].va = (t[i * 2].va + t[i * 2 + 1].va) % p;
}
long long Query(int i, int l, int r) {
  pushdown(i);
  int nowl = t[i].l, nowr = t[i].r;
  if (nowl > r || nowr < l) return 0;
  if (nowl >= l && nowr <= r) return t[i].va;
  return (Query(i * 2, l, r) + Query(i * 2 + 1, l, r)) % p;
}
int main() {
  f[0] = 0;
  f[1] = f[2] = 1;
  for (int i = 3; i <= 300005; i++) f[i] = (f[i - 2] + f[i - 1]) % p;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    int g, l, r;
    scanf("%d%d%d", &g, &l, &r);
    if (g == 1)
      add(1, l, r);
    else
      printf("%lld\n", Query(1, l, r));
  }
  return 0;
}

### Prompt

Generate a cpp solution 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>
using namespace std;
const long long p = 1e9 + 9;
int n, m;
struct data {
  long long va, lazy1, lazy2;
  int l, r;
} t[1200005];
long long a[300005], f[300007];
void build(int i, int l, int r) {
  t[i].l = l;
  t[i].r = r;
  if (l == r) {
    t[i].va = a[l];
    return;
  }
  int mid = (l + r) / 2;
  build(i * 2, l, mid);
  build(i * 2 + 1, mid + 1, r);
  t[i].va = (t[i * 2].va + t[i * 2 + 1].va) % p;
}
void pushdown(int i) {
  if (t[i].l == t[i].r) {
    t[i].va += t[i].lazy1;
    t[i].lazy1 = 0;
    return;
  }
  int len = t[i].r - t[i].l + 1;
  t[i].va += (f[len + 1] - 1) * t[i].lazy2 % p + f[len] * t[i].lazy1 % p;
  t[i].va %= p;
  t[i * 2].lazy1 = (t[i * 2].lazy1 + t[i].lazy1) % p;
  t[i * 2].lazy2 = (t[i * 2].lazy2 + t[i].lazy2) % p;
  int mid = (t[i].r + t[i].l) / 2 + 1;
  t[i * 2 + 1].lazy1 +=
      t[i].lazy1 * f[mid - 1 - t[i].l] % p + t[i].lazy2 * f[mid - t[i].l] % p;
  t[i * 2 + 1].lazy2 +=
      t[i].lazy1 * f[mid - t[i].l] % p + t[i].lazy2 * f[mid - t[i].l + 1] % p;
  t[i * 2 + 1].lazy1 %= p;
  t[i * 2 + 1].lazy2 %= p;
  t[i].lazy1 = t[i].lazy2 = 0;
}
void add(int i, int l, int r) {
  pushdown(i);
  int nowl = t[i].l, nowr = t[i].r;
  if (nowl > r || nowr < l) return;
  if (nowl >= l && nowr <= r) {
    int nowst = nowl - l + 1;
    t[i].lazy1 = (t[i].lazy1 + f[nowst]) % p;
    t[i].lazy2 = (t[i].lazy2 + f[nowst + 1]) % p;
    pushdown(i);
    return;
  }
  add(i * 2, l, r);
  add(i * 2 + 1, l, r);
  t[i].va = (t[i * 2].va + t[i * 2 + 1].va) % p;
}
long long Query(int i, int l, int r) {
  pushdown(i);
  int nowl = t[i].l, nowr = t[i].r;
  if (nowl > r || nowr < l) return 0;
  if (nowl >= l && nowr <= r) return t[i].va;
  return (Query(i * 2, l, r) + Query(i * 2 + 1, l, r)) % p;
}
int main() {
  f[0] = 0;
  f[1] = f[2] = 1;
  for (int i = 3; i <= 300005; i++) f[i] = (f[i - 2] + f[i - 1]) % p;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    int g, l, r;
    scanf("%d%d%d", &g, &l, &r);
    if (g == 1)
      add(1, l, r);
    else
      printf("%lld\n", Query(1, l, r));
  }
  return 0;
}

```