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 f[300000 + 10], a[300000 + 10];
int n, m;
struct TR {
  int l, r;
  int p1, p2;
  long long sum;
  int mid() { return (l + r) >> 1; }
  int len() { return r - l + 1; }
} tr[300000 * 4 + 10];
void update(int id, int l, int r, int p1, int p2);
long long fib(long long a, long long b, int n) {
  if (n == 1) return a;
  if (n == 2) return b;
  return (a * f[n - 2] % 1000000009 + b * f[n - 1] % 1000000009) % 1000000009;
}
void build(int id, int l, int r) {
  tr[id].l = l;
  tr[id].r = r;
  tr[id].p1 = tr[id].p2 = 0;
  if (l == r) {
    tr[id].sum = a[l];
    return;
  }
  int mid = tr[id].mid();
  build(id << 1, l, mid);
  build(id << 1 | 1, mid + 1, r);
  tr[id].sum = (tr[id << 1].sum + tr[id << 1 | 1].sum) % 1000000009;
}
void push_down(int id) {
  if (tr[id].p1 || tr[id].p2) {
    int mid = tr[id].mid();
    update(id << 1, tr[id].l, tr[id].r, tr[id].p1, tr[id].p2);
    update(id << 1 | 1, tr[id].l, tr[id].r, tr[id].p1, tr[id].p2);
    tr[id].p1 = 0;
    tr[id].p2 = 0;
  }
}
void update(int id, int l, int r, int p1, int p2) {
  if (l <= tr[id].l && tr[id].r <= r) {
    int tmp1, tmp2;
    tmp1 = fib(p1, p2, tr[id].l - l + 1);
    tmp2 = fib(p1, p2, tr[id].l - l + 2);
    tr[id].p1 = (tmp1 + tr[id].p1) % 1000000009;
    tr[id].p2 = (tmp2 + tr[id].p2) % 1000000009;
    tr[id].sum =
        (tr[id].sum + fib(tmp1, tmp2, tr[id].len() + 2) - tmp2 + 1000000009) %
        1000000009;
    return;
  }
  push_down(id);
  int mid = tr[id].mid();
  if (l <= mid) update(id << 1, l, r, p1, p2);
  if (r > mid) update(id << 1 | 1, l, r, p1, p2);
  tr[id].sum = (tr[id << 1].sum + tr[id << 1 | 1].sum) % 1000000009;
}
long long query(int id, int l, int r) {
  if (l <= tr[id].l && tr[id].r <= r) {
    return tr[id].sum;
  }
  int mid = tr[id].mid();
  push_down(id);
  long long ans = 0;
  if (l <= mid) ans = (ans + query(id << 1, l, r)) % 1000000009;
  if (mid < r) ans = (ans + query(id << 1 | 1, l, r)) % 1000000009;
  return ans;
}
int main() {
  int i, j;
  while (scanf("%d %d", &n, &m) != EOF) {
    f[1] = f[2] = 1;
    for (i = 3; i < n + 5; i++) f[i] = (f[i - 1] + f[i - 2]) % 1000000009;
    for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
    build(1, 1, n);
    int q, st, en;
    while (m--) {
      scanf("%d %d %d", &q, &st, &en);
      if (q == 1) {
        update(1, st, en, 1, 1);
      } else if (q == 2) {
        long long ans = query(1, st, en);
        printf("%I64d\n", ans);
      }
    }
  }
  return 0;
}
