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 f1[300007], f2[300007];
int b[300007];
struct T {
  long long mark1, mark2, sum;
  int l, r;
} a[300007 * 8];
long long calcSum(long long a1, long long a2, int n) {
  long long ans =
      (f1[n + 2] * a1 + a2 * (f2[n + 2] - 1) % 1000000009) % 1000000009;
  return ans < 0 ? ans + 1000000009 : ans;
}
long long calcF(long long a1, long long a2, int n) {
  return (a1 * f1[n] + a2 * f2[n]) % 1000000009;
}
int n, tot;
void build(int x, int l, int r) {
  a[x].l = l;
  a[x].r = r;
  a[x].sum = b[l];
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(x * 2, l, mid);
  build(x * 2 + 1, mid + 1, r);
  a[x].sum = a[x * 2].sum + a[x * 2 + 1].sum;
}
void modify(int x, long long v1, long long v2) {
  int len = a[x].r - a[x].l + 1;
  a[x].mark1 += v1;
  if (a[x].mark1 >= 1000000009) a[x].mark1 -= 1000000009;
  a[x].mark2 += v2;
  if (a[x].mark2 >= 1000000009) a[x].mark2 -= 1000000009;
  a[x].sum += calcSum(v1, v2, len);
  a[x].sum %= 1000000009;
}
void pushdown(int x) {
  if (a[x].l != a[x].r) {
    long long a1 = a[x].mark1, a2 = a[x].mark2;
    int len1 = a[x * 2].r - a[x * 2].l + 1;
    modify(x * 2, a1, a2);
    modify(x * 2 + 1, calcF(a1, a2, len1 + 1), calcF(a1, a2, len1 + 2));
  }
  a[x].mark1 = a[x].mark2 = 0;
}
void add(int x, int l, int r) {
  pushdown(x);
  if (l <= a[x].l && a[x].r <= r) {
    int p = a[x].l - l + 1;
    modify(x, calcF(1, 1, p), calcF(1, 1, p + 1));
  } else {
    int len = a[x].r - a[x].l + 1;
    int mid = (a[x].l + a[x].r) >> 1;
    if (l <= mid) add(x * 2, l, r);
    if (r > mid) add(x * 2 + 1, l, r);
    a[x].sum = (a[x * 2].sum + a[x * 2 + 1].sum) % 1000000009;
  }
}
long long query(int x, int l, int r) {
  pushdown(x);
  if (l <= a[x].l && a[x].r <= r) {
    return a[x].sum;
  } else {
    long long ans = 0;
    int mid = (a[x].l + a[x].r) >> 1;
    if (l <= mid) ans = query(x * 2, l, r);
    if (r > mid) ans = query(x * 2 + 1, l, r) + ans;
    if (ans > 1000000009) ans -= 1000000009;
    return ans;
  }
}
int main() {
  f1[1] = 1;
  f1[2] = 0;
  f2[1] = 0;
  f2[2] = 1;
  for (int i = 3; i < 300007; i++) {
    f1[i] = (f1[i - 2] + f1[i - 1]) % 1000000009;
    f2[i] = (f2[i - 2] + f2[i - 1]) % 1000000009;
  }
  int n, m, x, l, r;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", b + i);
  build(1, 1, n);
  while (m--) {
    scanf("%d%d%d", &x, &l, &r);
    if (x == 1)
      add(1, l, r);
    else
      printf("%I64d\n", query(1, l, r));
  }
  return 0;
}
