#include <bits/stdc++.h>
using namespace std;
vector<string> vec_splitter(string s) {
  for (char& c : s) c = c == ',' ? ' ' : c;
  stringstream ss;
  ss << s;
  vector<string> res;
  for (string z; ss >> z; res.push_back(z))
    ;
  return res;
}
void debug_out(vector<string> args, int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
  if (idx > 0) cerr << ", ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, T...);
}
void localTest() {}
const long long N = 3e5 + 5, MOD = 1e9 + 9;
long long first[N], A[N];
struct node {
  long long a, b, sum;
  node() : a(0), b(0), sum(0) {}
} T[N << 2];
long long fibo(long long x, long long y, long long k) {
  if (k == 1) return x;
  if (k == 2) return y;
  return (x * first[k - 2] + y * first[k - 1]) % MOD;
}
long long fiboSum(long long x, long long y, long long k) {
  if (k == 1) return x % MOD;
  if (k == 2) return (x + y) % MOD;
  return (fibo(x, y, k + 2) - y + MOD) % MOD;
}
void build(long long node, long long lo, long long hi) {
  if (lo == hi) {
    T[node].sum = A[lo];
    return;
  }
  long long mid = (lo + hi) >> 1;
  build(node << 1, lo, mid);
  build(node << 1 | 1, mid + 1, hi);
  T[node].sum = (T[node << 1].sum + T[node << 1 | 1].sum) % MOD;
  return;
}
void push(long long node, long long lo, long long hi) {
  long long mid = (lo + hi) >> 1;
  T[node].sum += fiboSum(T[node].a, T[node].b, hi - lo + 1);
  T[node].sum %= MOD;
  if (lo != hi) {
    T[node << 1].a += T[node].a;
    T[node << 1].b += T[node].b;
    T[node << 1].a %= MOD;
    T[node << 1].b %= MOD;
    T[node << 1 | 1].a += fibo(T[node].a, T[node].b, mid - lo + 2);
    T[node << 1 | 1].b += fibo(T[node].a, T[node].b, mid - lo + 3);
    T[node << 1 | 1].a %= MOD;
    T[node << 1 | 1].b %= MOD;
  }
  T[node].a = T[node].b = 0;
  return;
}
void update(long long node, long long lo, long long hi, long long l,
            long long r) {
  if (T[node].a) push(node, lo, hi);
  if (l > hi || r < lo) return;
  long long mid = (lo + hi) >> 1;
  if (lo >= l && hi <= r) {
    T[node].sum = (T[node].sum +
                   fiboSum(first[lo - l + 1], first[lo - l + 2], hi - lo + 1)) %
                  MOD;
    if (lo != hi) {
      T[node << 1].a += first[lo - l + 1];
      T[node << 1].b += first[lo - l + 2];
      T[node << 1].a %= MOD;
      T[node << 1].b %= MOD;
      T[node << 1 | 1].a += first[mid - l + 2];
      T[node << 1 | 1].b += first[mid - l + 3];
      T[node << 1 | 1].a %= MOD;
      T[node << 1 | 1].b %= MOD;
    }
    return;
  }
  update(node << 1, lo, mid, l, r);
  update(node << 1 | 1, mid + 1, hi, l, r);
  T[node].sum = (T[node << 1].sum + T[node << 1 | 1].sum) % MOD;
  return;
}
long long query(long long node, long long lo, long long hi, long long l,
                long long r) {
  if (T[node].a) push(node, lo, hi);
  if (l > hi || r < lo) return 0;
  if (lo >= l && hi <= r) return T[node].sum;
  long long mid = (lo + hi) >> 1;
  return (query(node << 1, lo, mid, l, r) +
          query(node << 1 | 1, mid + 1, hi, l, r)) %
         MOD;
}
int main() {
  localTest();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  first[1] = 1;
  for (long long i = 2; i < N; ++i)
    first[i] = (first[i - 1] + first[i - 2]) % MOD;
  cin >> n >> m;
  for (long long i = 1; i <= n; ++i) cin >> A[i];
  build(1, 1, n);
  while (m--) {
    long long ty, x, y;
    cin >> ty >> x >> y;
    if (ty == 1)
      update(1, 1, n, x, y);
    else
      cout << query(1, 1, n, x, y) << "\n";
  }
  return 0;
}

### 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;
vector<string> vec_splitter(string s) {
  for (char& c : s) c = c == ',' ? ' ' : c;
  stringstream ss;
  ss << s;
  vector<string> res;
  for (string z; ss >> z; res.push_back(z))
    ;
  return res;
}
void debug_out(vector<string> args, int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
  if (idx > 0) cerr << ", ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, T...);
}
void localTest() {}
const long long N = 3e5 + 5, MOD = 1e9 + 9;
long long first[N], A[N];
struct node {
  long long a, b, sum;
  node() : a(0), b(0), sum(0) {}
} T[N << 2];
long long fibo(long long x, long long y, long long k) {
  if (k == 1) return x;
  if (k == 2) return y;
  return (x * first[k - 2] + y * first[k - 1]) % MOD;
}
long long fiboSum(long long x, long long y, long long k) {
  if (k == 1) return x % MOD;
  if (k == 2) return (x + y) % MOD;
  return (fibo(x, y, k + 2) - y + MOD) % MOD;
}
void build(long long node, long long lo, long long hi) {
  if (lo == hi) {
    T[node].sum = A[lo];
    return;
  }
  long long mid = (lo + hi) >> 1;
  build(node << 1, lo, mid);
  build(node << 1 | 1, mid + 1, hi);
  T[node].sum = (T[node << 1].sum + T[node << 1 | 1].sum) % MOD;
  return;
}
void push(long long node, long long lo, long long hi) {
  long long mid = (lo + hi) >> 1;
  T[node].sum += fiboSum(T[node].a, T[node].b, hi - lo + 1);
  T[node].sum %= MOD;
  if (lo != hi) {
    T[node << 1].a += T[node].a;
    T[node << 1].b += T[node].b;
    T[node << 1].a %= MOD;
    T[node << 1].b %= MOD;
    T[node << 1 | 1].a += fibo(T[node].a, T[node].b, mid - lo + 2);
    T[node << 1 | 1].b += fibo(T[node].a, T[node].b, mid - lo + 3);
    T[node << 1 | 1].a %= MOD;
    T[node << 1 | 1].b %= MOD;
  }
  T[node].a = T[node].b = 0;
  return;
}
void update(long long node, long long lo, long long hi, long long l,
            long long r) {
  if (T[node].a) push(node, lo, hi);
  if (l > hi || r < lo) return;
  long long mid = (lo + hi) >> 1;
  if (lo >= l && hi <= r) {
    T[node].sum = (T[node].sum +
                   fiboSum(first[lo - l + 1], first[lo - l + 2], hi - lo + 1)) %
                  MOD;
    if (lo != hi) {
      T[node << 1].a += first[lo - l + 1];
      T[node << 1].b += first[lo - l + 2];
      T[node << 1].a %= MOD;
      T[node << 1].b %= MOD;
      T[node << 1 | 1].a += first[mid - l + 2];
      T[node << 1 | 1].b += first[mid - l + 3];
      T[node << 1 | 1].a %= MOD;
      T[node << 1 | 1].b %= MOD;
    }
    return;
  }
  update(node << 1, lo, mid, l, r);
  update(node << 1 | 1, mid + 1, hi, l, r);
  T[node].sum = (T[node << 1].sum + T[node << 1 | 1].sum) % MOD;
  return;
}
long long query(long long node, long long lo, long long hi, long long l,
                long long r) {
  if (T[node].a) push(node, lo, hi);
  if (l > hi || r < lo) return 0;
  if (lo >= l && hi <= r) return T[node].sum;
  long long mid = (lo + hi) >> 1;
  return (query(node << 1, lo, mid, l, r) +
          query(node << 1 | 1, mid + 1, hi, l, r)) %
         MOD;
}
int main() {
  localTest();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  first[1] = 1;
  for (long long i = 2; i < N; ++i)
    first[i] = (first[i - 1] + first[i - 2]) % MOD;
  cin >> n >> m;
  for (long long i = 1; i <= n; ++i) cin >> A[i];
  build(1, 1, n);
  while (m--) {
    long long ty, x, y;
    cin >> ty >> x >> y;
    if (ty == 1)
      update(1, 1, n, x, y);
    else
      cout << query(1, 1, n, x, y) << "\n";
  }
  return 0;
}

```