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 mod = 1e9 + 9;
int n, m, a[300010], b[300010];
pair<long long, long long> sum[300010 << 2], lzy[300010 << 2];
long long sqrt5 = 383008016, sa[300010], sb[300010], sainv[300010],
          sbinv[300010], x[300010];
void pushdown(int rt, int l, int r) {
  if (lzy[rt].first || lzy[rt].second) {
    int mid = (l + r) / 2;
    sum[rt << 1].first += sa[mid - l + 1] * lzy[rt].first % mod;
    sum[rt << 1].first %= mod;
    sum[rt << 1].second += sb[mid - l + 1] * lzy[rt].second % mod;
    sum[rt << 1].second %= mod;
    sum[rt << 1 | 1].first +=
        sa[r - mid] * lzy[rt].first % mod * a[mid - l + 1] % mod;
    sum[rt << 1 | 1].first %= mod;
    sum[rt << 1 | 1].second +=
        sb[r - mid] * lzy[rt].second % mod * b[mid - l + 1] % mod;
    ;
    sum[rt << 1 | 1].second %= mod;
    lzy[rt << 1].first += lzy[rt].first;
    lzy[rt << 1].first %= mod;
    lzy[rt << 1].second += lzy[rt].second;
    lzy[rt << 1].second %= mod;
    lzy[rt << 1 | 1].first += lzy[rt].first * a[mid + 1 - l] % mod;
    lzy[rt << 1 | 1].first %= mod;
    lzy[rt << 1 | 1].second += lzy[rt].second * b[mid + 1 - l] % mod;
    lzy[rt << 1 | 1].second %= mod;
    lzy[rt].first = lzy[rt].second = 0;
  }
}
void pushup(int rt) {
  sum[rt].first = (sum[rt << 1].first + sum[rt << 1 | 1].first) % mod;
  sum[rt].second = (sum[rt << 1].second + sum[rt << 1 | 1].second) % mod;
}
void update(int rt, int l, int r, int nl, int nr) {
  if (nl <= l && r <= nr) {
    long long ca = (sa[r - nl + 1] - sa[l - nl]) % mod;
    long long cb = (sb[r - nl + 1] - sb[l - nl]) % mod;
    sum[rt].first += ca;
    sum[rt].first %= mod;
    sum[rt].second += cb;
    sum[rt].second %= mod;
    lzy[rt].first += a[l - nl];
    lzy[rt].first %= mod;
    lzy[rt].second += b[l - nl];
    lzy[rt].second %= mod;
    return;
  }
  pushdown(rt, l, r);
  int mid = (l + r) / 2;
  if (nl <= mid) update(rt << 1, l, mid, nl, nr);
  if (mid < nr) update(rt << 1 | 1, mid + 1, r, nl, nr);
  pushup(rt);
}
pair<long long, long long> query(int rt, int l, int r, int nl, int nr) {
  if (nl <= l && r <= nr) return sum[rt];
  pushdown(rt, l, r);
  int mid = (l + r) / 2;
  pair<long long, long long> ret = make_pair(0, 0);
  if (nl <= mid) {
    pair<long long, long long> tmp = query(rt << 1, l, mid, nl, nr);
    ret.first += tmp.first;
    ret.first %= mod;
    ret.second += tmp.second;
    ret.second %= mod;
  }
  if (mid < nr) {
    pair<long long, long long> tmp = query(rt << 1 | 1, mid + 1, r, nl, nr);
    ret.first += tmp.first;
    ret.first %= mod;
    ret.second += tmp.second;
    ret.second %= mod;
  }
  return ret;
}
long long exgcd(long long a, long long &x, long long b, long long &y) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  }
  long long d = exgcd(b, y, a % b, x);
  y -= x * (a / b);
  return d;
}
long long inv(long long a) {
  long long x, y;
  exgcd(a, x, mod, y);
  return x % mod;
}
int main() {
  long long A = (mod + 1) / 2 * (sqrt5 + 1) % mod;
  long long B = (mod + 1) / 2 * (mod + 1 - sqrt5) % mod;
  a[0] = b[0] = 1;
  for (int i = 1; i <= 300009; ++i) {
    a[i] = a[i - 1] * A % mod;
    sa[i] = (sa[i - 1] + a[i]) % mod;
    b[i] = b[i - 1] * B % mod;
    sb[i] = (sb[i - 1] + b[i]) % mod;
  }
  sainv[300000] = inv(sa[300000]);
  sbinv[300000] = inv(sb[300000]);
  for (int i = 300000; i >= 1; --i) {
    sainv[i - 1] = sainv[i] * A % mod;
    sbinv[i - 1] = sbinv[i] * B % mod;
  }
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &x[i]);
    x[i] += x[i - 1];
    x[i] %= mod;
  }
  while (m--) {
    int opt, l, r;
    scanf("%d%d%d", &opt, &l, &r);
    if (opt == 1) {
      update(1, 1, n, l, r);
    } else {
      pair<long long, long long> tmp = query(1, 1, n, l, r);
      long long ans = tmp.first - tmp.second;
      ans = ans % mod * inv(sqrt5) % mod + (x[r] - x[l - 1]) % mod;
      ans = (ans % mod + mod) % mod;
      printf("%lld\n", ans);
    }
  }
}
