#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int MOD = int(1e9) + 9, N = int(3e5) + 5;
int fcum[N], f[N], a[N], lazy[N], cum[N];
vector<pair<int, int> > buffer;
int mod(int a) {
  a %= MOD;
  if (a < 0) a += MOD;
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  int SQRT = sqrt(m);
  f[1] = 1;
  f[2] = 1;
  fcum[1] = 1;
  fcum[2] = 2;
  for (int i = 3; i < N; i++) {
    f[i] = mod(f[i - 1] + f[i - 2]);
    fcum[i] = mod(fcum[i - 1] + f[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    cum[i] = mod(a[i] + cum[i - 1]);
  }
  for (int i = 0; i < m; i++) {
    int choice, l, r;
    scanf("%d", &choice);
    scanf("%d", &l);
    scanf("%d", &r);
    if (choice == 1) {
      lazy[l] = mod(lazy[l] + 1);
      lazy[r + 1] = (lazy[r + 1] - (f[r - l] + f[r - l + 1]) % MOD) % MOD;
      lazy[r + 2] = (lazy[r + 2] - f[r - l + 1]) % MOD;
      buffer.push_back({l, r});
    } else {
      int answer = (cum[r] - cum[l - 1] + MOD) % MOD;
      for (int j = 0; j < (int)(buffer.size()); j++) {
        int L = buffer[j].first, R = buffer[j].second;
        if (l > R || r < L) continue;
        int pos, a, b;
        if (l <= L)
          a = 1, pos = L;
        else
          a = l - L + 1, pos = l;
        if (r <= R)
          b = (r - pos) + a;
        else
          b = (R - pos) + a;
        answer = mod(answer + (fcum[b] - fcum[a - 1]));
      }
      printf("%d\n", answer);
    }
    if ((int)(buffer.size()) > SQRT) {
      a[1] = (lazy[1] + a[1]) % MOD;
      cum[1] = a[1];
      for (int z = 2; z < N; z++) {
        lazy[z] = mod(lazy[z] + (lazy[z - 1] + lazy[z - 2]) % MOD);
        a[z] = mod(a[z] + lazy[z]);
        cum[z] = mod(a[z] + cum[z - 1]);
        lazy[z - 2] = 0;
      }
      lazy[N - 2] = lazy[N - 1] = 0;
      buffer.clear();
    }
  }
  return 0;
}

### Prompt

Please formulate 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;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int MOD = int(1e9) + 9, N = int(3e5) + 5;
int fcum[N], f[N], a[N], lazy[N], cum[N];
vector<pair<int, int> > buffer;
int mod(int a) {
  a %= MOD;
  if (a < 0) a += MOD;
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  int SQRT = sqrt(m);
  f[1] = 1;
  f[2] = 1;
  fcum[1] = 1;
  fcum[2] = 2;
  for (int i = 3; i < N; i++) {
    f[i] = mod(f[i - 1] + f[i - 2]);
    fcum[i] = mod(fcum[i - 1] + f[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    cum[i] = mod(a[i] + cum[i - 1]);
  }
  for (int i = 0; i < m; i++) {
    int choice, l, r;
    scanf("%d", &choice);
    scanf("%d", &l);
    scanf("%d", &r);
    if (choice == 1) {
      lazy[l] = mod(lazy[l] + 1);
      lazy[r + 1] = (lazy[r + 1] - (f[r - l] + f[r - l + 1]) % MOD) % MOD;
      lazy[r + 2] = (lazy[r + 2] - f[r - l + 1]) % MOD;
      buffer.push_back({l, r});
    } else {
      int answer = (cum[r] - cum[l - 1] + MOD) % MOD;
      for (int j = 0; j < (int)(buffer.size()); j++) {
        int L = buffer[j].first, R = buffer[j].second;
        if (l > R || r < L) continue;
        int pos, a, b;
        if (l <= L)
          a = 1, pos = L;
        else
          a = l - L + 1, pos = l;
        if (r <= R)
          b = (r - pos) + a;
        else
          b = (R - pos) + a;
        answer = mod(answer + (fcum[b] - fcum[a - 1]));
      }
      printf("%d\n", answer);
    }
    if ((int)(buffer.size()) > SQRT) {
      a[1] = (lazy[1] + a[1]) % MOD;
      cum[1] = a[1];
      for (int z = 2; z < N; z++) {
        lazy[z] = mod(lazy[z] + (lazy[z - 1] + lazy[z - 2]) % MOD);
        a[z] = mod(a[z] + lazy[z]);
        cum[z] = mod(a[z] + cum[z - 1]);
        lazy[z - 2] = 0;
      }
      lazy[N - 2] = lazy[N - 1] = 0;
      buffer.clear();
    }
  }
  return 0;
}

```