#include <bits/stdc++.h>
using namespace std;
const int mod = 1000 * 1000 * 1000 + 9;
const int INF = 1e9 + 100;
const long long LINF = 1e18 + 100;
int n, m, a[300100];
int seg[4 * 300100];
int lz[4 * 300100][2];
int fib[300100];
inline int getnth(int a, int b, int n) {
  if (n == 1) return a;
  return (fib[n - 2] * (long long)a + fib[n - 1] * (long long)b) % mod;
}
inline int getsum(int a, int b, int n) {
  return (getnth(a, b, n + 2) - b) % mod;
}
void build(int v = 1, int l = 0, int r = n - 1) {
  if (l == r) {
    seg[v] = a[l];
    return;
  }
  int mid = (r + l) / 2;
  build(2 * v, l, mid);
  build(2 * v + 1, mid + 1, r);
  seg[v] = (seg[2 * v] + seg[2 * v + 1]) % mod;
}
void pushdown(int v, int l, int r) {
  if (!lz[v][0] && !lz[v][1]) return;
  int a = lz[v][0];
  int b = lz[v][1];
  int mid = (r + l) / 2;
  seg[2 * v] = (seg[2 * v] + getsum(a, b, mid - l + 1)) % mod;
  lz[2 * v][0] = (lz[2 * v][0] + a) % mod;
  lz[2 * v][1] = (lz[2 * v][1] + b) % mod;
  int x = b;
  b = getnth(a, b, mid - l + 3);
  a = getnth(a, x, mid - l + 2);
  seg[2 * v + 1] = (seg[2 * v + 1] + getsum(a, b, r - mid)) % mod;
  lz[2 * v + 1][0] = (lz[2 * v + 1][0] + a) % mod;
  lz[2 * v + 1][1] = (lz[2 * v + 1][1] + b) % mod;
  lz[v][0] = lz[v][1] = 0;
}
void add(int L, int R, int a, int b, int v = 1, int l = 0, int r = n - 1) {
  if (l > R || r < L) return;
  if (l >= L && r <= R) {
    int fa = getnth(a, b, l - L + 1);
    int fb = getnth(a, b, l - L + 2);
    seg[v] = (seg[v] + getsum(fa, fb, r - l + 1)) % mod;
    lz[v][0] = (lz[v][0] + fa) % mod;
    lz[v][1] = (lz[v][1] + fb) % mod;
    return;
  }
  int mid = (r + l) / 2;
  pushdown(v, l, r);
  add(L, R, a, b, 2 * v, l, mid);
  add(L, R, a, b, 2 * v + 1, mid + 1, r);
  seg[v] = (seg[2 * v] + seg[2 * v + 1]) % mod;
}
int get(int L, int R, int v = 1, int l = 0, int r = n - 1) {
  if (l > R || r < L) return 0;
  if (l >= L && r <= R) return seg[v];
  int mid = (r + l) / 2;
  pushdown(v, l, r);
  return (get(L, R, 2 * v, l, mid) + get(L, R, 2 * v + 1, mid + 1, r)) % mod;
}
int32_t main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  for (int i = (0); i < (int)(n); i++) cin >> a[i];
  fib[0] = 0;
  fib[1] = 1;
  for (int i = (2); i < (int)(300100); i++)
    fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
  build();
  while (m--) {
    int op, l, r;
    cin >> op >> l >> r;
    l--;
    r--;
    if (op == 1) {
      add(l, r, 1, 1);
    } else {
      int ans = get(l, r);
      ans = (mod + ans % mod) % mod;
      cout << ans << '\n';
    }
  }
  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 mod = 1000 * 1000 * 1000 + 9;
const int INF = 1e9 + 100;
const long long LINF = 1e18 + 100;
int n, m, a[300100];
int seg[4 * 300100];
int lz[4 * 300100][2];
int fib[300100];
inline int getnth(int a, int b, int n) {
  if (n == 1) return a;
  return (fib[n - 2] * (long long)a + fib[n - 1] * (long long)b) % mod;
}
inline int getsum(int a, int b, int n) {
  return (getnth(a, b, n + 2) - b) % mod;
}
void build(int v = 1, int l = 0, int r = n - 1) {
  if (l == r) {
    seg[v] = a[l];
    return;
  }
  int mid = (r + l) / 2;
  build(2 * v, l, mid);
  build(2 * v + 1, mid + 1, r);
  seg[v] = (seg[2 * v] + seg[2 * v + 1]) % mod;
}
void pushdown(int v, int l, int r) {
  if (!lz[v][0] && !lz[v][1]) return;
  int a = lz[v][0];
  int b = lz[v][1];
  int mid = (r + l) / 2;
  seg[2 * v] = (seg[2 * v] + getsum(a, b, mid - l + 1)) % mod;
  lz[2 * v][0] = (lz[2 * v][0] + a) % mod;
  lz[2 * v][1] = (lz[2 * v][1] + b) % mod;
  int x = b;
  b = getnth(a, b, mid - l + 3);
  a = getnth(a, x, mid - l + 2);
  seg[2 * v + 1] = (seg[2 * v + 1] + getsum(a, b, r - mid)) % mod;
  lz[2 * v + 1][0] = (lz[2 * v + 1][0] + a) % mod;
  lz[2 * v + 1][1] = (lz[2 * v + 1][1] + b) % mod;
  lz[v][0] = lz[v][1] = 0;
}
void add(int L, int R, int a, int b, int v = 1, int l = 0, int r = n - 1) {
  if (l > R || r < L) return;
  if (l >= L && r <= R) {
    int fa = getnth(a, b, l - L + 1);
    int fb = getnth(a, b, l - L + 2);
    seg[v] = (seg[v] + getsum(fa, fb, r - l + 1)) % mod;
    lz[v][0] = (lz[v][0] + fa) % mod;
    lz[v][1] = (lz[v][1] + fb) % mod;
    return;
  }
  int mid = (r + l) / 2;
  pushdown(v, l, r);
  add(L, R, a, b, 2 * v, l, mid);
  add(L, R, a, b, 2 * v + 1, mid + 1, r);
  seg[v] = (seg[2 * v] + seg[2 * v + 1]) % mod;
}
int get(int L, int R, int v = 1, int l = 0, int r = n - 1) {
  if (l > R || r < L) return 0;
  if (l >= L && r <= R) return seg[v];
  int mid = (r + l) / 2;
  pushdown(v, l, r);
  return (get(L, R, 2 * v, l, mid) + get(L, R, 2 * v + 1, mid + 1, r)) % mod;
}
int32_t main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  for (int i = (0); i < (int)(n); i++) cin >> a[i];
  fib[0] = 0;
  fib[1] = 1;
  for (int i = (2); i < (int)(300100); i++)
    fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
  build();
  while (m--) {
    int op, l, r;
    cin >> op >> l >> r;
    l--;
    r--;
    if (op == 1) {
      add(l, r, 1, 1);
    } else {
      int ans = get(l, r);
      ans = (mod + ans % mod) % mod;
      cout << ans << '\n';
    }
  }
  return 0;
}

```