#include <bits/stdc++.h>
int a[300001], ll[1200004], rr[1200004], f[300001] = {0, 1};
long long sum[1200004], lz1[1200004], lz2[1200004];
void build(int l, int r, int i) {
  ll[i] = l;
  rr[i] = r;
  lz1[i] = lz2[i] = 0;
  if (l == r) {
    sum[i] = a[l];
    return;
  }
  int m = l + r >> 1, ls = i << 1;
  build(l, m, ls);
  build(m + 1, r, ls | 1);
  sum[i] = sum[ls] + sum[ls | 1];
}
void down(int i) {
  int m = ll[i] + rr[i] >> 1, ls = i << 1, rs = ls | 1;
  long long z2, z1;
  lz1[ls] += lz1[i];
  lz2[ls] += lz2[i];
  if (lz1[ls] >= 1000000009) lz1[ls] -= 1000000009;
  if (lz2[ls] >= 1000000009) lz2[ls] -= 1000000009;
  sum[ls] =
      (sum[ls] + lz1[i] * f[m - ll[i] + 1] + lz2[i] * (f[m - ll[i] + 2] - 1)) %
      1000000009;
  z1 = lz2[i] * f[m - ll[i] + 1] + lz1[i] * f[m - ll[i]];
  z2 = lz2[i] * f[m - ll[i] + 2] + lz1[i] * f[m - ll[i] + 1];
  z1 %= 1000000009;
  z2 %= 1000000009;
  lz1[rs] += z1;
  lz2[rs] += z2;
  if (lz1[rs] >= 1000000009) lz1[rs] -= 1000000009;
  if (lz2[rs] >= 1000000009) lz2[rs] -= 1000000009;
  sum[rs] =
      (sum[rs] + z1 * f[rr[i] - m] + z2 * (f[rr[i] - m + 1] - 1)) % 1000000009;
  lz1[i] = lz2[i] = 0;
}
void update(int l, int r, int i, long long z1, long long z2) {
  if (ll[i] == l && rr[i] == r) {
    lz1[i] += z1;
    lz2[i] += z2;
    if (lz1[i] >= 1000000009) lz1[i] -= 1000000009;
    if (lz2[i] >= 1000000009) lz2[i] -= 1000000009;
    sum[i] =
        (sum[i] + z1 * f[r - l + 1] + z2 * (f[r - l + 2] - 1)) % 1000000009;
    return;
  }
  if (lz1[i]) down(i);
  int m = ll[i] + rr[i] >> 1, ls = i << 1, rs = ls | 1;
  if (r <= m)
    update(l, r, ls, z1, z2);
  else if (l > m)
    update(l, r, rs, z1, z2);
  else {
    update(l, m, ls, z1, z2);
    update(m + 1, r, rs, (z2 * f[m - l + 1] + z1 * f[m - l]) % 1000000009,
           (z2 * f[m - l + 2] + z1 * f[m - l + 1]) % 1000000009);
  }
  sum[i] = sum[ls] + sum[rs];
}
long long query(int l, int r, int i) {
  if (ll[i] == l && rr[i] == r) return sum[i];
  if (lz1[i]) down(i);
  int m = ll[i] + rr[i] >> 1, ls = i << 1;
  if (r <= m)
    return query(l, r, ls);
  else if (l > m)
    return query(l, r, ls | 1);
  else
    return query(l, m, ls) + query(m + 1, r, ls | 1);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  for (int i = 2; i <= n + 1; ++i) {
    f[i] = f[i - 1] + f[i - 2];
    if (f[i] >= 1000000009) f[i] -= 1000000009;
  }
  build(1, n, 1);
  int q, l0, r0, ans;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d%d", &q, &l0, &r0);
    if (q == 1)
      update(l0, r0, 1, 1, 1);
    else {
      ans = query(l0, r0, 1) % 1000000009;
      if (ans < 0) ans += 1000000009;
      printf("%d\n", ans);
    }
  }
  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>
int a[300001], ll[1200004], rr[1200004], f[300001] = {0, 1};
long long sum[1200004], lz1[1200004], lz2[1200004];
void build(int l, int r, int i) {
  ll[i] = l;
  rr[i] = r;
  lz1[i] = lz2[i] = 0;
  if (l == r) {
    sum[i] = a[l];
    return;
  }
  int m = l + r >> 1, ls = i << 1;
  build(l, m, ls);
  build(m + 1, r, ls | 1);
  sum[i] = sum[ls] + sum[ls | 1];
}
void down(int i) {
  int m = ll[i] + rr[i] >> 1, ls = i << 1, rs = ls | 1;
  long long z2, z1;
  lz1[ls] += lz1[i];
  lz2[ls] += lz2[i];
  if (lz1[ls] >= 1000000009) lz1[ls] -= 1000000009;
  if (lz2[ls] >= 1000000009) lz2[ls] -= 1000000009;
  sum[ls] =
      (sum[ls] + lz1[i] * f[m - ll[i] + 1] + lz2[i] * (f[m - ll[i] + 2] - 1)) %
      1000000009;
  z1 = lz2[i] * f[m - ll[i] + 1] + lz1[i] * f[m - ll[i]];
  z2 = lz2[i] * f[m - ll[i] + 2] + lz1[i] * f[m - ll[i] + 1];
  z1 %= 1000000009;
  z2 %= 1000000009;
  lz1[rs] += z1;
  lz2[rs] += z2;
  if (lz1[rs] >= 1000000009) lz1[rs] -= 1000000009;
  if (lz2[rs] >= 1000000009) lz2[rs] -= 1000000009;
  sum[rs] =
      (sum[rs] + z1 * f[rr[i] - m] + z2 * (f[rr[i] - m + 1] - 1)) % 1000000009;
  lz1[i] = lz2[i] = 0;
}
void update(int l, int r, int i, long long z1, long long z2) {
  if (ll[i] == l && rr[i] == r) {
    lz1[i] += z1;
    lz2[i] += z2;
    if (lz1[i] >= 1000000009) lz1[i] -= 1000000009;
    if (lz2[i] >= 1000000009) lz2[i] -= 1000000009;
    sum[i] =
        (sum[i] + z1 * f[r - l + 1] + z2 * (f[r - l + 2] - 1)) % 1000000009;
    return;
  }
  if (lz1[i]) down(i);
  int m = ll[i] + rr[i] >> 1, ls = i << 1, rs = ls | 1;
  if (r <= m)
    update(l, r, ls, z1, z2);
  else if (l > m)
    update(l, r, rs, z1, z2);
  else {
    update(l, m, ls, z1, z2);
    update(m + 1, r, rs, (z2 * f[m - l + 1] + z1 * f[m - l]) % 1000000009,
           (z2 * f[m - l + 2] + z1 * f[m - l + 1]) % 1000000009);
  }
  sum[i] = sum[ls] + sum[rs];
}
long long query(int l, int r, int i) {
  if (ll[i] == l && rr[i] == r) return sum[i];
  if (lz1[i]) down(i);
  int m = ll[i] + rr[i] >> 1, ls = i << 1;
  if (r <= m)
    return query(l, r, ls);
  else if (l > m)
    return query(l, r, ls | 1);
  else
    return query(l, m, ls) + query(m + 1, r, ls | 1);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  for (int i = 2; i <= n + 1; ++i) {
    f[i] = f[i - 1] + f[i - 2];
    if (f[i] >= 1000000009) f[i] -= 1000000009;
  }
  build(1, n, 1);
  int q, l0, r0, ans;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d%d", &q, &l0, &r0);
    if (q == 1)
      update(l0, r0, 1, 1, 1);
    else {
      ans = query(l0, r0, 1) % 1000000009;
      if (ans < 0) ans += 1000000009;
      printf("%d\n", ans);
    }
  }
  return 0;
}

```