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.
#include <bits/stdc++.h>
using namespace std;
long long fi[311111], fib[311111];
long long sum[311111 << 2];
const long long mof = 1000000009;
pair<long long, long long> add[311111 << 2], iadd;
bool ifadd[311111 << 2];
long long n, m, a, b, c;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
void init() {
  fi[1] = fi[2] = fib[1] = 1;
  fib[2] = 2;
  for (register long long i = 3; i <= 311111; ++i) {
    fi[i] = (fi[i - 1] + fi[i - 2]) % mof;
    fib[i] = (fi[i] + fib[i - 1]) % mof;
  }
}
void pushup(long long rt) { sum[rt] = (sum[rt << 1] + sum[rt << 1 | 1]) % mof; }
void pushdown(int l, int r, int rt) {
  if (l == r) return;
  if (ifadd[rt]) {
    long long mid = (l + r) >> 1;
    add[rt << 1].first = (add[rt << 1].first + add[rt].first) % mof;
    add[rt << 1].second = (add[rt << 1].second + add[rt].second) % mof;
    sum[rt << 1] =
        (sum[rt << 1] + ((add[rt].second * fi[mid - l + 1 + 2 - 1] % mof +
                          add[rt].first * fi[mid - l + 1 + 2 - 2] % mof) %
                             mof -
                         add[rt].second + mof) %
                            mof) %
        mof;
    iadd.first = (add[rt].second * fi[mid - l + 2 - 1] % mof +
                  add[rt].first * fi[mid - l + 2 - 2] % mof) %
                 mof;
    iadd.second = (add[rt].second * fi[mid - l + 3 - 1] % mof +
                   add[rt].first * fi[mid - l + 3 - 2] % mof) %
                  mof;
    add[rt << 1 | 1].first = (add[rt << 1 | 1].first + iadd.first) % mof;
    add[rt << 1 | 1].second = (add[rt << 1 | 1].second + iadd.second) % mof;
    sum[rt << 1 | 1] =
        (sum[rt << 1 | 1] + ((iadd.second * fi[r - mid + 2 - 1] % mof +
                              iadd.first * fi[r - mid + 2 - 2] % mof) %
                                 mof -
                             iadd.second + mof) %
                                mof) %
        mof;
    add[rt].first = add[rt].second = 0;
    ifadd[rt] = false;
    ifadd[rt << 1] = ifadd[rt << 1 | 1] = true;
  }
}
void build(long long l, long long r, long long rt) {
  if (l == r) {
    sum[rt] = read();
    return;
  }
  long long mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
  pushup(rt);
}
long long query(long long l, long long r, long long rt) {
  if (a <= l && r <= b) return sum[rt];
  pushdown(l, r, rt);
  long long ans = 0;
  long long mid = (l + r) >> 1;
  if (a <= mid) ans += query(l, mid, rt << 1);
  if (mid < b) ans += query(mid + 1, r, rt << 1 | 1);
  ans %= mof;
  return ans;
}
void update(long long l, long long r, long long rt) {
  if (a <= l && r <= b) {
    add[rt].first = (add[rt].first + fi[l - a + 1]) % mof;
    add[rt].second = (add[rt].second + fi[l + 1 - a + 1]) % mof;
    sum[rt] = (sum[rt] + (fib[r - a + 1] - fib[l - a] + mof) % mof) % mof;
    ifadd[rt] = true;
    return;
  }
  long long mid = (l + r) >> 1;
  pushdown(l, r, rt);
  if (a <= mid) update(l, mid, rt << 1);
  if (mid < b) update(mid + 1, r, rt << 1 | 1);
  pushup(rt);
}
int main() {
  init();
  n = read(), m = read();
  build(1, n, 1);
  while (m--) {
    c = read(), a = read(), b = read();
    if (c - 1)
      printf("%I64d\n", query(1, n, 1));
    else
      update(1, n, 1);
  }
}
