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>
const int mod = 1e9 + 9;
const int N = 3e5 + 5;
using namespace std;
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * w;
}
long long a[N], f[N], sum[N];
long long solve1(long long x, long long y, long long l) {
  if (l == 1) return x;
  if (l == 2) return y;
  return (x * f[l - 2] + y * f[l - 1]) % mod;
}
long long solve2(long long x, long long y, long long l) {
  if (l == 1) return x;
  if (l == 2) return (x + y) % mod;
  return (solve1(x, y, l + 2) - y + mod) % mod;
}
namespace Segment {
struct node {
  long long c1, c2, sum;
} t[N * 20];
void pushup(int k) { t[k].sum = (t[k << 1].sum + t[k << 1 | 1].sum) % mod; }
void pushdown(int k, int l, int r) {
  if (!t[k].c1) return;
  int mid = l + r >> 1;
  t[k << 1].c1 = (t[k << 1].c1 + t[k].c1) % mod;
  t[k << 1].c2 = (t[k << 1].c2 + t[k].c2) % mod;
  t[k << 1].sum = (t[k << 1].sum + solve2(t[k].c1, t[k].c2, mid - l + 1)) % mod;
  long long x = solve1(t[k].c1, t[k].c2, mid - l + 2),
            y = solve1(t[k].c1, t[k].c2, mid - l + 3);
  t[k << 1 | 1].c1 = (t[k << 1 | 1].c1 + x) % mod;
  t[k << 1 | 1].c2 = (t[k << 1 | 1].c2 + y) % mod;
  t[k << 1 | 1].sum = (t[k << 1 | 1].sum + solve2(x, y, r - mid)) % mod;
  t[k].c1 = 0, t[k].c2 = 0;
}
void update(int k, int l, int r, int L, int R) {
  if (L <= l && r <= R) {
    t[k].c1 = (t[k].c1 + f[l - L + 1]) % mod;
    t[k].c2 = (t[k].c2 + f[l - L + 2]) % mod;
    t[k].sum = (t[k].sum + solve2(f[l - L + 1], f[l - L + 2], r - l + 1)) % mod;
    return;
  }
  pushdown(k, l, r);
  int mid = l + r >> 1;
  if (L <= mid) update(k << 1, l, mid, L, R);
  if (R > mid) update(k << 1 | 1, mid + 1, r, L, R);
  pushup(k);
}
long long query(int k, int l, int r, int L, int R) {
  long long res = 0;
  if (L <= l && r <= R) {
    res = t[k].sum;
    return (res + mod) % mod;
  }
  pushdown(k, l, r);
  int mid = l + r >> 1;
  if (L <= mid) res += query(k << 1, l, mid, L, R);
  if (R > mid) res += query(k << 1 | 1, mid + 1, r, L, R);
  return (res + mod) % mod;
}
}  // namespace Segment
int n, m;
void init() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) {
    long long x = read();
    a[i] = (a[i - 1] + x) % mod;
  }
  f[1] = 1, f[2] = 1;
  for (int i = 3; i <= n + 2; i++) f[i] = (f[i - 1] + f[i - 2]) % mod;
  return;
}
using namespace Segment;
void solve() {
  for (int i = 1; i <= m; i++) {
    int opt = read(), x = read(), y = read();
    if (opt == 1)
      update(1, 1, n, x, y);
    else
      printf("%lld\n", (mod + query(1, 1, n, x, y) + a[y] - a[x - 1]) % mod);
  }
  return;
}
int main() {
  init();
  solve();
  return 0;
}
