#include <bits/stdc++.h>
using namespace std;
const int XXY = 1e9 + 9;
int n, m;
int seg[1300000], flag[1300000][2], fab[300010];
inline int find(int x, int y, int num) {
  if (num == 1) return x;
  if (num == 2) return y;
  return (1ll * x * fab[num - 2] + 1ll * y * fab[num - 1]) % XXY;
}
inline int work(int x, int y, int num) {
  return (find(x, y, num + 2) - y + XXY) % XXY;
}
inline void pull(int rt) {
  (seg[rt] = seg[rt << 1] + seg[(rt << 1) + 1]) %= XXY;
}
void push(int rt, int l, int r, int len) {
  if (flag[rt][0] || flag[rt][1]) {
    int lson = rt << 1, rson = (rt << 1) + 1, mid = (l + r) >> 1;
    (flag[lson][0] += flag[rt][0]) %= XXY;
    (flag[lson][1] += flag[rt][1]) %= XXY;
    int rx = find(flag[rt][0], flag[rt][1], mid - l + 2),
        ry = find(flag[rt][0], flag[rt][1], mid - l + 3);
    (flag[rson][0] += rx) %= XXY;
    (flag[rson][1] += ry) %= XXY;
    (seg[lson] += work(flag[rt][0], flag[rt][1], mid - l + 1)) %= XXY;
    (seg[rson] += work(rx, ry, r - mid)) %= XXY;
    flag[rt][0] = flag[rt][1] = 0;
  }
}
void build(int rt, int l, int r) {
  flag[rt][0] = 0;
  flag[rt][1] = 0;
  if (l == r) {
    scanf("%d", &seg[rt]);
    return;
  }
  int mid = (l + r) >> 1;
  build(rt << 1, l, mid);
  build((rt << 1) + 1, mid + 1, r);
  pull(rt);
}
void update(int rt, int l, int r, int x, int y) {
  if (x <= l && r <= y) {
    (flag[rt][0] += fab[l - x + 1]) %= XXY;
    (flag[rt][1] += fab[l - x + 2]) %= XXY;
    (seg[rt] += work(fab[l - x + 1], fab[l - x + 2], r - l + 1)) %= XXY;
    return;
  }
  push(rt, l, r, r - l + 1);
  int mid = (l + r) >> 1;
  if (mid >= x) update(rt << 1, l, mid, x, y);
  if (mid < y) update((rt << 1) + 1, mid + 1, r, x, y);
  pull(rt);
}
int query(int rt, int l, int r, int x, int y) {
  if (x <= l && r <= y) return seg[rt];
  push(rt, l, r, r - l + 1);
  int mid = (l + r) >> 1, ans = 0;
  if (mid >= x) ans += query(rt << 1, l, mid, x, y);
  if (mid < y) ans += query((rt << 1) + 1, mid + 1, r, x, y);
  return ans % XXY;
}
int main() {
  scanf("%d%d", &n, &m);
  build(1, 1, n);
  fab[1] = fab[2] = 1;
  for (int i = 3; i <= n + 10; i++) {
    fab[i] = (fab[i - 1] + fab[i - 2]) % XXY;
  }
  int op, par1, par2;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &op, &par1, &par2);
    if (op == 1)
      update(1, 1, n, par1, par2);
    else
      printf("%d\n", query(1, 1, n, par1, par2));
  }
  return 0;
}

### Prompt

Your task is to create 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 int XXY = 1e9 + 9;
int n, m;
int seg[1300000], flag[1300000][2], fab[300010];
inline int find(int x, int y, int num) {
  if (num == 1) return x;
  if (num == 2) return y;
  return (1ll * x * fab[num - 2] + 1ll * y * fab[num - 1]) % XXY;
}
inline int work(int x, int y, int num) {
  return (find(x, y, num + 2) - y + XXY) % XXY;
}
inline void pull(int rt) {
  (seg[rt] = seg[rt << 1] + seg[(rt << 1) + 1]) %= XXY;
}
void push(int rt, int l, int r, int len) {
  if (flag[rt][0] || flag[rt][1]) {
    int lson = rt << 1, rson = (rt << 1) + 1, mid = (l + r) >> 1;
    (flag[lson][0] += flag[rt][0]) %= XXY;
    (flag[lson][1] += flag[rt][1]) %= XXY;
    int rx = find(flag[rt][0], flag[rt][1], mid - l + 2),
        ry = find(flag[rt][0], flag[rt][1], mid - l + 3);
    (flag[rson][0] += rx) %= XXY;
    (flag[rson][1] += ry) %= XXY;
    (seg[lson] += work(flag[rt][0], flag[rt][1], mid - l + 1)) %= XXY;
    (seg[rson] += work(rx, ry, r - mid)) %= XXY;
    flag[rt][0] = flag[rt][1] = 0;
  }
}
void build(int rt, int l, int r) {
  flag[rt][0] = 0;
  flag[rt][1] = 0;
  if (l == r) {
    scanf("%d", &seg[rt]);
    return;
  }
  int mid = (l + r) >> 1;
  build(rt << 1, l, mid);
  build((rt << 1) + 1, mid + 1, r);
  pull(rt);
}
void update(int rt, int l, int r, int x, int y) {
  if (x <= l && r <= y) {
    (flag[rt][0] += fab[l - x + 1]) %= XXY;
    (flag[rt][1] += fab[l - x + 2]) %= XXY;
    (seg[rt] += work(fab[l - x + 1], fab[l - x + 2], r - l + 1)) %= XXY;
    return;
  }
  push(rt, l, r, r - l + 1);
  int mid = (l + r) >> 1;
  if (mid >= x) update(rt << 1, l, mid, x, y);
  if (mid < y) update((rt << 1) + 1, mid + 1, r, x, y);
  pull(rt);
}
int query(int rt, int l, int r, int x, int y) {
  if (x <= l && r <= y) return seg[rt];
  push(rt, l, r, r - l + 1);
  int mid = (l + r) >> 1, ans = 0;
  if (mid >= x) ans += query(rt << 1, l, mid, x, y);
  if (mid < y) ans += query((rt << 1) + 1, mid + 1, r, x, y);
  return ans % XXY;
}
int main() {
  scanf("%d%d", &n, &m);
  build(1, 1, n);
  fab[1] = fab[2] = 1;
  for (int i = 3; i <= n + 10; i++) {
    fab[i] = (fab[i - 1] + fab[i - 2]) % XXY;
  }
  int op, par1, par2;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &op, &par1, &par2);
    if (op == 1)
      update(1, 1, n, par1, par2);
    else
      printf("%d\n", query(1, 1, n, par1, par2));
  }
  return 0;
}

```