#include <bits/stdc++.h>
using namespace std;
inline void SetIO(string Name) {
  string In = Name + ".in", Out = Name + ".out";
  freopen(In.c_str(), "r", stdin), freopen(Out.c_str(), "w", stdout);
}
const int N = 300010, Mod = 1000000009;
inline pair<long long, long long> operator+(pair<long long, long long> A,
                                            pair<long long, long long> B) {
  long long a = (A.first + B.first) % Mod, b = (A.second + B.second) % Mod;
  return pair<long long, long long>(a, b);
}
inline long long operator*(pair<long long, long long> A,
                           pair<long long, long long> B) {
  long long Ret = A.first * B.first + A.second * B.second;
  return Ret % Mod;
}
struct Node {
  int Child[2];
  long long Cnt;
  pair<long long, long long> Tag;
} Tr[N * 2];
int Tot, S, l, r;
pair<long long, long long> Fib[N], Sum[N];
int n, m, Arr[N];
inline void Input() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (n); i++) scanf("%d", Arr + i);
}
inline void Updata(int x) {
  Tr[x].Cnt = (Tr[Tr[x].Child[0]].Cnt + Tr[Tr[x].Child[1]].Cnt) % Mod;
}
inline void Build(int l, int r) {
  int x = ++Tot, Mid = (l + r) >> 1;
  if (l == r)
    Tr[x].Cnt = Arr[l], Tr[x].Tag = pair<long long, long long>(0, 0);
  else {
    Tr[x].Child[0] = Tot + 1;
    Build(l, Mid);
    Tr[x].Child[1] = Tot + 1;
    Build(Mid + 1, r);
    Updata(x);
  }
}
inline long long Value(pair<long long, long long> A) {
  return (A.first + A.second) % Mod;
}
inline void Push(int x, int Len, pair<long long, long long> T) {
  Tr[x].Tag = Tr[x].Tag + T, Tr[x].Cnt = (Tr[x].Cnt + T * Sum[Len]) % Mod;
}
inline void Pushdown(int x, int L, int R, int Mid) {
  if (Tr[x].Tag.first || Tr[x].Tag.second) {
    Push(Tr[x].Child[0], Mid - L + 1, Tr[x].Tag);
    Tr[x].Tag = pair<long long, long long>(Tr[x].Tag * Fib[Mid + 1 - L + 1],
                                           Tr[x].Tag * Fib[Mid + 2 - L + 1]);
    Push(Tr[x].Child[1], R - Mid, Tr[x].Tag);
    Tr[x].Tag = pair<long long, long long>(0, 0);
  }
}
inline void Modify(int x, int L, int R) {
  if (R < l || L > r) return;
  if (L >= l && R <= r) {
    long long A = Value(Fib[S]), B = Value(Fib[S + 1]);
    Push(x, R - L + 1, pair<long long, long long>(A, B));
    S += R - L + 1;
  } else {
    int Mid = (L + R) >> 1;
    Pushdown(x, L, R, Mid);
    Modify(Tr[x].Child[0], L, Mid);
    Modify(Tr[x].Child[1], Mid + 1, R);
    Updata(x);
  }
}
inline long long Query(int x, int L, int R) {
  if (R < l || L > r) return 0;
  if (L >= l && R <= r) return Tr[x].Cnt;
  int Mid = (L + R) >> 1;
  Pushdown(x, L, R, Mid);
  return (Query(Tr[x].Child[0], L, Mid) + Query(Tr[x].Child[1], Mid + 1, R)) %
         Mod;
}
inline void Solve() {
  Tot = 0, Build(1, n);
  Fib[1] = pair<long long, long long>(1, 0),
  Fib[2] = pair<long long, long long>(0, 1);
  for (int i = (3); i <= (n); i++) Fib[i] = Fib[i - 1] + Fib[i - 2];
  Sum[1] = Fib[1];
  for (int i = (2); i <= (n); i++) Sum[i] = Sum[i - 1] + Fib[i];
  int Opt;
  while (m--) {
    scanf("%d%d%d", &Opt, &l, &r);
    if (Opt == 1) {
      S = 1;
      Modify(1, 1, n);
    } else
      printf("%d\n", (int)Query(1, 1, n));
  }
}
int main() {
  Input();
  Solve();
  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;
inline void SetIO(string Name) {
  string In = Name + ".in", Out = Name + ".out";
  freopen(In.c_str(), "r", stdin), freopen(Out.c_str(), "w", stdout);
}
const int N = 300010, Mod = 1000000009;
inline pair<long long, long long> operator+(pair<long long, long long> A,
                                            pair<long long, long long> B) {
  long long a = (A.first + B.first) % Mod, b = (A.second + B.second) % Mod;
  return pair<long long, long long>(a, b);
}
inline long long operator*(pair<long long, long long> A,
                           pair<long long, long long> B) {
  long long Ret = A.first * B.first + A.second * B.second;
  return Ret % Mod;
}
struct Node {
  int Child[2];
  long long Cnt;
  pair<long long, long long> Tag;
} Tr[N * 2];
int Tot, S, l, r;
pair<long long, long long> Fib[N], Sum[N];
int n, m, Arr[N];
inline void Input() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (n); i++) scanf("%d", Arr + i);
}
inline void Updata(int x) {
  Tr[x].Cnt = (Tr[Tr[x].Child[0]].Cnt + Tr[Tr[x].Child[1]].Cnt) % Mod;
}
inline void Build(int l, int r) {
  int x = ++Tot, Mid = (l + r) >> 1;
  if (l == r)
    Tr[x].Cnt = Arr[l], Tr[x].Tag = pair<long long, long long>(0, 0);
  else {
    Tr[x].Child[0] = Tot + 1;
    Build(l, Mid);
    Tr[x].Child[1] = Tot + 1;
    Build(Mid + 1, r);
    Updata(x);
  }
}
inline long long Value(pair<long long, long long> A) {
  return (A.first + A.second) % Mod;
}
inline void Push(int x, int Len, pair<long long, long long> T) {
  Tr[x].Tag = Tr[x].Tag + T, Tr[x].Cnt = (Tr[x].Cnt + T * Sum[Len]) % Mod;
}
inline void Pushdown(int x, int L, int R, int Mid) {
  if (Tr[x].Tag.first || Tr[x].Tag.second) {
    Push(Tr[x].Child[0], Mid - L + 1, Tr[x].Tag);
    Tr[x].Tag = pair<long long, long long>(Tr[x].Tag * Fib[Mid + 1 - L + 1],
                                           Tr[x].Tag * Fib[Mid + 2 - L + 1]);
    Push(Tr[x].Child[1], R - Mid, Tr[x].Tag);
    Tr[x].Tag = pair<long long, long long>(0, 0);
  }
}
inline void Modify(int x, int L, int R) {
  if (R < l || L > r) return;
  if (L >= l && R <= r) {
    long long A = Value(Fib[S]), B = Value(Fib[S + 1]);
    Push(x, R - L + 1, pair<long long, long long>(A, B));
    S += R - L + 1;
  } else {
    int Mid = (L + R) >> 1;
    Pushdown(x, L, R, Mid);
    Modify(Tr[x].Child[0], L, Mid);
    Modify(Tr[x].Child[1], Mid + 1, R);
    Updata(x);
  }
}
inline long long Query(int x, int L, int R) {
  if (R < l || L > r) return 0;
  if (L >= l && R <= r) return Tr[x].Cnt;
  int Mid = (L + R) >> 1;
  Pushdown(x, L, R, Mid);
  return (Query(Tr[x].Child[0], L, Mid) + Query(Tr[x].Child[1], Mid + 1, R)) %
         Mod;
}
inline void Solve() {
  Tot = 0, Build(1, n);
  Fib[1] = pair<long long, long long>(1, 0),
  Fib[2] = pair<long long, long long>(0, 1);
  for (int i = (3); i <= (n); i++) Fib[i] = Fib[i - 1] + Fib[i - 2];
  Sum[1] = Fib[1];
  for (int i = (2); i <= (n); i++) Sum[i] = Sum[i - 1] + Fib[i];
  int Opt;
  while (m--) {
    scanf("%d%d%d", &Opt, &l, &r);
    if (Opt == 1) {
      S = 1;
      Modify(1, 1, n);
    } else
      printf("%d\n", (int)Query(1, 1, n));
  }
}
int main() {
  Input();
  Solve();
  return 0;
}

```