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;
const long long mxn = 1e6 + 5, mod = 1e9 + 9;
long long n, m, cnt, a[mxn], hd[mxn];
long long f[mxn], tr[mxn << 2], vis[mxn << 2], tag[mxn << 2][2];
inline long long read() {
  char c = getchar();
  long long x = 0, f = 1;
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    x = (x << 3) + (x << 1) + (c & 15);
    c = getchar();
  }
  return x * f;
}
inline void chkmax(long long &x, long long y) {
  if (x < y) x = y;
}
inline void chkmin(long long &x, long long y) {
  if (x > y) x = y;
}
struct ed {
  long long to, nxt;
} t[mxn << 1];
inline void add(long long u, long long v) {
  t[++cnt] = (ed){v, hd[u]};
  hd[u] = cnt;
}
void push_up(long long p) { tr[p] = (tr[p << 1] + tr[p << 1 | 1]) % mod; }
struct ST {
  long long x, y;
};
ST fibget(ST tp, long long len) {
  long long c = tp.x * f[len] % mod + tp.y * f[len + 1] % mod,
            d = tp.x * f[len + 1] % mod + tp.y * f[len + 2] % mod;
  return (ST){c % mod, d % mod};
}
long long fibcal(long long f1, long long f2, long long len) {
  long long res = 0;
  if (len >= 1) res = f1;
  if (len >= 2) res = (res + f2) % mod;
  if (len >= 3)
    res = (res + f2 * (f[len + 1] - 2) % mod + f1 * (f[len] - 1) % mod + mod) %
          mod;
  return res;
}
void push_down(long long p, long long l, long long r) {
  long long mid = (l + r) >> 1;
  if (vis[p]) {
    long long &a = tag[p][0], &b = tag[p][1];
    tag[p << 1][0] = (tag[p << 1][0] + a) % mod;
    tag[p << 1][1] = (tag[p << 1][1] + b) % mod;
    tr[p << 1] = (tr[p << 1] + fibcal(a, b, mid - l + 1)) % mod;
    vis[p << 1] = 1;
    long long c = a * f[mid - l] + b * f[mid - l + 1],
              d = a * f[mid - l + 1] + b * f[mid - l + 2];
    c %= mod;
    d %= mod;
    tag[p << 1 | 1][0] = (tag[p << 1 | 1][0] + c) % mod;
    tag[p << 1 | 1][1] = (tag[p << 1 | 1][1] + d) % mod;
    tr[p << 1 | 1] = (tr[p << 1 | 1] + fibcal(c, d, r - mid)) % mod;
    vis[p << 1 | 1] = 1;
    vis[p] = tag[p][0] = tag[p][1] = 0;
  }
}
void build(long long l, long long r, long long p) {
  if (l == r) {
    tr[p] = a[l];
    return;
  }
  long long mid = (l + r) >> 1;
  build(l, mid, p << 1);
  build(mid + 1, r, p << 1 | 1);
  push_up(p);
}
void modify(long long l, long long r, long long ql, long long qr,
            long long val1, long long val2, long long p) {
  if (ql <= l && r <= qr) {
    tag[p][0] = (tag[p][0] + val1) % mod;
    tag[p][1] = (tag[p][1] + val2) % mod;
    tr[p] = (tr[p] + fibcal(val1, val2, r - l + 1)) % mod;
    vis[p] = 1;
    return;
  }
  long long mid = (l + r) >> 1;
  push_down(p, l, r);
  if (qr <= mid)
    modify(l, mid, ql, qr, val1, val2, p << 1);
  else if (ql > mid)
    modify(mid + 1, r, ql, qr, val1, val2, p << 1 | 1);
  else {
    modify(l, mid, ql, qr, val1, val2, p << 1);
    ST z = fibget((ST){val1, val2}, mid - ql);
    modify(mid + 1, r, mid + 1, qr, z.x, z.y, p << 1 | 1);
  }
  push_up(p);
}
long long query(long long l, long long r, long long ql, long long qr,
                long long p) {
  if (ql <= l && r <= qr) return tr[p];
  long long mid = (l + r) >> 1;
  push_down(p, l, r);
  long long res = 0;
  if (ql <= mid) res = (res + query(l, mid, ql, qr, p << 1)) % mod;
  if (qr > mid) res = (res + query(mid + 1, r, ql, qr, p << 1 | 1)) % mod;
  return res;
}
void init() {
  n = read();
  m = read();
  long long x, y, opt;
  f[1] = f[2] = 1;
  for (long long i = 3; i <= n + 4; ++i) f[i] = (f[i - 1] + f[i - 2]) % mod;
  for (long long i = 1; i <= n; ++i) a[i] = read() % mod;
  build(1, n, 1);
  for (long long i = 1; i <= m; ++i) {
    opt = read();
    x = read();
    y = read();
    if (opt == 1)
      modify(1, n, x, y, 1, 1, 1);
    else
      printf("%lld\n", (query(1, n, x, y, 1) + mod) % mod);
  }
}
int main() {
  init();
  return 0;
}
