#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
int n, q, t, L, R, f[N], a[N];
int st[1 << 20];
pair<int, int> lazy[1 << 20];
int F(int i, int a, int b) {
  return (a * 1LL * f[i - 2] % 1000000009 + b * 1LL * f[i - 1] % 1000000009) %
         1000000009;
}
int sum(int k, int a, int b) {
  return (F(k + 2, a, b) - F(2, a, b) + 1000000009) % 1000000009;
}
void update(int p, int x, int y, int i, int j, int a, int b) {
  if (lazy[p].first) {
    st[p] =
        (st[p] + sum(y - x + 1, lazy[p].first, lazy[p].second)) % 1000000009;
    if (x != y) {
      lazy[(p << 1)].first =
          (lazy[(p << 1)].first + lazy[p].first) % 1000000009;
      lazy[(p << 1)].second =
          (lazy[(p << 1)].second + lazy[p].second) % 1000000009;
      int t, aa, bb;
      t = ((x + y) >> 1) - x + 2;
      aa = F(t, lazy[p].first, lazy[p].second);
      bb = F(t + 1, lazy[p].first, lazy[p].second);
      lazy[(p << 1 | 1)].first = (lazy[(p << 1 | 1)].first + aa) % 1000000009;
      lazy[(p << 1 | 1)].second = (lazy[(p << 1 | 1)].second + bb) % 1000000009;
    }
    lazy[p].first = lazy[p].second = 0;
  }
  if (i > y || j < x) return;
  if (i <= x && y <= j) {
    st[p] = (st[p] + sum(y - x + 1, a, b)) % 1000000009;
    if (x != y) {
      lazy[(p << 1)].first = (lazy[(p << 1)].first + a) % 1000000009;
      lazy[(p << 1)].second = (lazy[(p << 1)].second + b) % 1000000009;
      int t, aa, bb;
      t = ((x + y) >> 1) - x + 2;
      aa = F(t, a, b);
      bb = F(t + 1, a, b);
      lazy[(p << 1 | 1)].first = (lazy[(p << 1 | 1)].first + aa) % 1000000009;
      lazy[(p << 1 | 1)].second = (lazy[(p << 1 | 1)].second + bb) % 1000000009;
    }
    return;
  }
  int aa = a, bb = b, t = ((x + y) >> 1) - max(x, i) + 2;
  if (((x + y) >> 1) >= i) {
    aa = F(t, a, b);
    bb = F(t + 1, a, b);
  }
  update((p << 1), x, ((x + y) >> 1), i, j, a, b);
  update((p << 1 | 1), ((x + y) >> 1) + 1, y, i, j, aa, bb);
  st[p] = (st[(p << 1)] + st[(p << 1 | 1)]) % 1000000009;
}
int get(int p, int x, int y, int i, int j) {
  if (lazy[p].first) {
    st[p] =
        (st[p] + sum(y - x + 1, lazy[p].first, lazy[p].second)) % 1000000009;
    if (x != y) {
      lazy[(p << 1)].first =
          (lazy[(p << 1)].first + lazy[p].first) % 1000000009;
      lazy[(p << 1)].second =
          (lazy[(p << 1)].second + lazy[p].second) % 1000000009;
      int t, aa, bb;
      t = ((x + y) >> 1) - x + 2;
      aa = F(t, lazy[p].first, lazy[p].second);
      bb = F(t + 1, lazy[p].first, lazy[p].second);
      lazy[(p << 1 | 1)].first = (lazy[(p << 1 | 1)].first + aa) % 1000000009;
      lazy[(p << 1 | 1)].second = (lazy[(p << 1 | 1)].second + bb) % 1000000009;
    }
    lazy[p].first = lazy[p].second = 0;
  }
  if (i > y || j < x) return 0;
  if (i <= x && y <= j) return st[p];
  return (get((p << 1), x, ((x + y) >> 1), i, j) +
          get((p << 1 | 1), ((x + y) >> 1) + 1, y, i, j)) %
         1000000009;
}
int main(int argc, char **argv) {
  f[1] = f[2] = 1;
  for (int i = 3; i < N; ++i) f[i] = (f[i - 1] + f[i - 2]) % 1000000009;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) a[i] = (a[i] + a[i - 1]) % 1000000009;
  while (q--) {
    scanf("%d%d%d", &t, &L, &R);
    if (t == 1)
      update(1, 1, n, L, R, 1, 1);
    else
      printf("%d\n", (get(1, 1, n, L, R) +
                      (a[R] - a[L - 1] + 1000000009) % 1000000009) %
                         1000000009);
  }
  return 0;
}

### Prompt

Construct a Cpp code solution to the problem outlined:

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 int N = 300010;
int n, q, t, L, R, f[N], a[N];
int st[1 << 20];
pair<int, int> lazy[1 << 20];
int F(int i, int a, int b) {
  return (a * 1LL * f[i - 2] % 1000000009 + b * 1LL * f[i - 1] % 1000000009) %
         1000000009;
}
int sum(int k, int a, int b) {
  return (F(k + 2, a, b) - F(2, a, b) + 1000000009) % 1000000009;
}
void update(int p, int x, int y, int i, int j, int a, int b) {
  if (lazy[p].first) {
    st[p] =
        (st[p] + sum(y - x + 1, lazy[p].first, lazy[p].second)) % 1000000009;
    if (x != y) {
      lazy[(p << 1)].first =
          (lazy[(p << 1)].first + lazy[p].first) % 1000000009;
      lazy[(p << 1)].second =
          (lazy[(p << 1)].second + lazy[p].second) % 1000000009;
      int t, aa, bb;
      t = ((x + y) >> 1) - x + 2;
      aa = F(t, lazy[p].first, lazy[p].second);
      bb = F(t + 1, lazy[p].first, lazy[p].second);
      lazy[(p << 1 | 1)].first = (lazy[(p << 1 | 1)].first + aa) % 1000000009;
      lazy[(p << 1 | 1)].second = (lazy[(p << 1 | 1)].second + bb) % 1000000009;
    }
    lazy[p].first = lazy[p].second = 0;
  }
  if (i > y || j < x) return;
  if (i <= x && y <= j) {
    st[p] = (st[p] + sum(y - x + 1, a, b)) % 1000000009;
    if (x != y) {
      lazy[(p << 1)].first = (lazy[(p << 1)].first + a) % 1000000009;
      lazy[(p << 1)].second = (lazy[(p << 1)].second + b) % 1000000009;
      int t, aa, bb;
      t = ((x + y) >> 1) - x + 2;
      aa = F(t, a, b);
      bb = F(t + 1, a, b);
      lazy[(p << 1 | 1)].first = (lazy[(p << 1 | 1)].first + aa) % 1000000009;
      lazy[(p << 1 | 1)].second = (lazy[(p << 1 | 1)].second + bb) % 1000000009;
    }
    return;
  }
  int aa = a, bb = b, t = ((x + y) >> 1) - max(x, i) + 2;
  if (((x + y) >> 1) >= i) {
    aa = F(t, a, b);
    bb = F(t + 1, a, b);
  }
  update((p << 1), x, ((x + y) >> 1), i, j, a, b);
  update((p << 1 | 1), ((x + y) >> 1) + 1, y, i, j, aa, bb);
  st[p] = (st[(p << 1)] + st[(p << 1 | 1)]) % 1000000009;
}
int get(int p, int x, int y, int i, int j) {
  if (lazy[p].first) {
    st[p] =
        (st[p] + sum(y - x + 1, lazy[p].first, lazy[p].second)) % 1000000009;
    if (x != y) {
      lazy[(p << 1)].first =
          (lazy[(p << 1)].first + lazy[p].first) % 1000000009;
      lazy[(p << 1)].second =
          (lazy[(p << 1)].second + lazy[p].second) % 1000000009;
      int t, aa, bb;
      t = ((x + y) >> 1) - x + 2;
      aa = F(t, lazy[p].first, lazy[p].second);
      bb = F(t + 1, lazy[p].first, lazy[p].second);
      lazy[(p << 1 | 1)].first = (lazy[(p << 1 | 1)].first + aa) % 1000000009;
      lazy[(p << 1 | 1)].second = (lazy[(p << 1 | 1)].second + bb) % 1000000009;
    }
    lazy[p].first = lazy[p].second = 0;
  }
  if (i > y || j < x) return 0;
  if (i <= x && y <= j) return st[p];
  return (get((p << 1), x, ((x + y) >> 1), i, j) +
          get((p << 1 | 1), ((x + y) >> 1) + 1, y, i, j)) %
         1000000009;
}
int main(int argc, char **argv) {
  f[1] = f[2] = 1;
  for (int i = 3; i < N; ++i) f[i] = (f[i - 1] + f[i - 2]) % 1000000009;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) a[i] = (a[i] + a[i - 1]) % 1000000009;
  while (q--) {
    scanf("%d%d%d", &t, &L, &R);
    if (t == 1)
      update(1, 1, n, L, R, 1, 1);
    else
      printf("%d\n", (get(1, 1, n, L, R) +
                      (a[R] - a[L - 1] + 1000000009) % 1000000009) %
                         1000000009);
  }
  return 0;
}

```