#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T min(T &a, T &b) {
  return a < b ? a : b;
}
template <class T>
inline T max(T &a, T &b) {
  return a > b ? a : b;
}
inline void read(int &x) {
  char ch;
  while ((ch = getchar()) && !(ch >= '0' && ch <= '9'))
    ;
  x = ch - '0';
  while ((ch = getchar()) && (ch >= '0' && ch <= '9')) x = x * 10 + ch - '0';
}
struct point {
  int x, y;
  point() {}
  point(int _x, int _y) : x(_x), y(_y) {}
};
const int Mod = 1000000009;
const int N = 500000;
int n, m, W[N];
pair<int, int> val[N], sum[N];
struct lj {
  int l, r, f1, f2, c;
} t[N << 2];
int Chen(int x, int y) {
  return int((long long)x * (long long)y % (long long)Mod);
}
int ADD(int x, int y) { return (x + y) % Mod; }
void build(int w, int l, int r) {
  t[w].l = l;
  t[w].r = r;
  if (l == r) {
    t[w].c = W[l];
    return;
  }
  int mid = l + r >> 1;
  build(w << 1, l, mid);
  build(w << 1 | 1, mid + 1, r);
  t[w].c = ADD(t[w << 1].c, t[w << 1 | 1].c);
}
void push(int w) {
  if (t[w].f1 || t[w].f2) {
    int l = w << 1;
    t[l].f1 = ADD(t[l].f1, t[w].f1);
    t[l].f2 = ADD(t[l].f2, t[w].f2);
    pair<int, int> c = sum[t[l].r - t[l].l + 1];
    t[l].c = ADD(ADD(Chen(c.first, t[w].f1), Chen(c.second, t[w].f2)), t[l].c);
    int mid = t[w].l + t[w].r >> 1;
    l |= 1;
    int d, e;
    d = ADD(Chen(val[mid - t[w].l + 2].first, t[w].f1),
            Chen(val[mid - t[w].l + 2].second, t[w].f2));
    e = ADD(Chen(val[mid - t[w].l + 3].first, t[w].f1),
            Chen(val[mid - t[w].l + 3].second, t[w].f2));
    t[l].f1 = ADD(t[l].f1, d);
    t[l].f2 = ADD(t[l].f2, e);
    c = sum[t[l].r - t[l].l + 1];
    t[l].c = ADD(ADD(Chen(c.first, d), Chen(c.second, e)), t[l].c);
    t[w].f1 = t[w].f2 = 0;
  }
}
void change(int w, int l, int r, int p, int q) {
  if (t[w].l == l && t[w].r == r) {
    pair<int, int> c = sum[r - l + 1];
    t[w].c = ADD(t[w].c, ADD(Chen(c.first, p), Chen(c.second, q)));
    t[w].f1 = ADD(t[w].f1, p);
    t[w].f2 = ADD(t[w].f2, q);
    return;
  }
  push(w);
  int mid = t[w].l + t[w].r >> 1;
  if (r <= mid)
    change(w << 1, l, r, p, q);
  else if (l > mid)
    change(w << 1 | 1, l, r, p, q);
  else {
    change(w << 1, l, mid, p, q);
    int d, e;
    d = ADD(Chen(val[mid - l + 2].first, p), Chen(val[mid - l + 2].second, q));
    e = ADD(Chen(val[mid - l + 3].first, p), Chen(val[mid - l + 3].second, q));
    change(w << 1 | 1, mid + 1, r, d, e);
  }
  t[w].c = ADD(t[w << 1].c, t[w << 1 | 1].c);
}
int ask(int w, int l, int r) {
  if (t[w].l == l && t[w].r == r) return t[w].c;
  push(w);
  int mid = t[w].l + t[w].r >> 1;
  if (r <= mid)
    return ask(w << 1, l, r);
  else if (l > mid)
    return ask(w << 1 | 1, l, r);
  else
    return ADD(ask(w << 1, l, mid), ask(w << 1 | 1, mid + 1, r));
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &W[i]);
  sum[1] = make_pair(1, 0);
  sum[2] = make_pair(1, 1);
  val[1] = make_pair(1, 0);
  val[2] = make_pair(0, 1);
  for (int i = 3; i <= n; i++)
    val[i] = make_pair(ADD(val[i - 1].first, val[i - 2].first),
                       ADD(val[i - 1].second, val[i - 2].second)),
    sum[i] = make_pair(ADD(val[i].first, sum[i - 1].first),
                       ADD(val[i].second, sum[i - 1].second));
  build(1, 1, n);
  int ty, x, y;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &ty);
    if (ty == 1) {
      scanf("%d%d", &x, &y);
      change(1, x, y, 1, 1);
    }
    if (ty == 2) {
      scanf("%d%d", &x, &y);
      printf("%d\n", ask(1, x, y));
    }
  }
}

### Prompt

Create a solution in cpp for 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;
template <class T>
inline T min(T &a, T &b) {
  return a < b ? a : b;
}
template <class T>
inline T max(T &a, T &b) {
  return a > b ? a : b;
}
inline void read(int &x) {
  char ch;
  while ((ch = getchar()) && !(ch >= '0' && ch <= '9'))
    ;
  x = ch - '0';
  while ((ch = getchar()) && (ch >= '0' && ch <= '9')) x = x * 10 + ch - '0';
}
struct point {
  int x, y;
  point() {}
  point(int _x, int _y) : x(_x), y(_y) {}
};
const int Mod = 1000000009;
const int N = 500000;
int n, m, W[N];
pair<int, int> val[N], sum[N];
struct lj {
  int l, r, f1, f2, c;
} t[N << 2];
int Chen(int x, int y) {
  return int((long long)x * (long long)y % (long long)Mod);
}
int ADD(int x, int y) { return (x + y) % Mod; }
void build(int w, int l, int r) {
  t[w].l = l;
  t[w].r = r;
  if (l == r) {
    t[w].c = W[l];
    return;
  }
  int mid = l + r >> 1;
  build(w << 1, l, mid);
  build(w << 1 | 1, mid + 1, r);
  t[w].c = ADD(t[w << 1].c, t[w << 1 | 1].c);
}
void push(int w) {
  if (t[w].f1 || t[w].f2) {
    int l = w << 1;
    t[l].f1 = ADD(t[l].f1, t[w].f1);
    t[l].f2 = ADD(t[l].f2, t[w].f2);
    pair<int, int> c = sum[t[l].r - t[l].l + 1];
    t[l].c = ADD(ADD(Chen(c.first, t[w].f1), Chen(c.second, t[w].f2)), t[l].c);
    int mid = t[w].l + t[w].r >> 1;
    l |= 1;
    int d, e;
    d = ADD(Chen(val[mid - t[w].l + 2].first, t[w].f1),
            Chen(val[mid - t[w].l + 2].second, t[w].f2));
    e = ADD(Chen(val[mid - t[w].l + 3].first, t[w].f1),
            Chen(val[mid - t[w].l + 3].second, t[w].f2));
    t[l].f1 = ADD(t[l].f1, d);
    t[l].f2 = ADD(t[l].f2, e);
    c = sum[t[l].r - t[l].l + 1];
    t[l].c = ADD(ADD(Chen(c.first, d), Chen(c.second, e)), t[l].c);
    t[w].f1 = t[w].f2 = 0;
  }
}
void change(int w, int l, int r, int p, int q) {
  if (t[w].l == l && t[w].r == r) {
    pair<int, int> c = sum[r - l + 1];
    t[w].c = ADD(t[w].c, ADD(Chen(c.first, p), Chen(c.second, q)));
    t[w].f1 = ADD(t[w].f1, p);
    t[w].f2 = ADD(t[w].f2, q);
    return;
  }
  push(w);
  int mid = t[w].l + t[w].r >> 1;
  if (r <= mid)
    change(w << 1, l, r, p, q);
  else if (l > mid)
    change(w << 1 | 1, l, r, p, q);
  else {
    change(w << 1, l, mid, p, q);
    int d, e;
    d = ADD(Chen(val[mid - l + 2].first, p), Chen(val[mid - l + 2].second, q));
    e = ADD(Chen(val[mid - l + 3].first, p), Chen(val[mid - l + 3].second, q));
    change(w << 1 | 1, mid + 1, r, d, e);
  }
  t[w].c = ADD(t[w << 1].c, t[w << 1 | 1].c);
}
int ask(int w, int l, int r) {
  if (t[w].l == l && t[w].r == r) return t[w].c;
  push(w);
  int mid = t[w].l + t[w].r >> 1;
  if (r <= mid)
    return ask(w << 1, l, r);
  else if (l > mid)
    return ask(w << 1 | 1, l, r);
  else
    return ADD(ask(w << 1, l, mid), ask(w << 1 | 1, mid + 1, r));
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &W[i]);
  sum[1] = make_pair(1, 0);
  sum[2] = make_pair(1, 1);
  val[1] = make_pair(1, 0);
  val[2] = make_pair(0, 1);
  for (int i = 3; i <= n; i++)
    val[i] = make_pair(ADD(val[i - 1].first, val[i - 2].first),
                       ADD(val[i - 1].second, val[i - 2].second)),
    sum[i] = make_pair(ADD(val[i].first, sum[i - 1].first),
                       ADD(val[i].second, sum[i - 1].second));
  build(1, 1, n);
  int ty, x, y;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &ty);
    if (ty == 1) {
      scanf("%d%d", &x, &y);
      change(1, x, y, 1, 1);
    }
    if (ty == 2) {
      scanf("%d%d", &x, &y);
      printf("%d\n", ask(1, x, y));
    }
  }
}

```