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 double PI = acos(-1);
using namespace std;
int n, m;
struct node {
  long long x1, x2, val, ch;
  node() { x1 = x2 = val = ch = 0; }
};
node dp[300300 * 8];
long long pr1[300300];
long long pr2[300300];
long long fi1[300300];
long long fi2[300300];
void update(int p) {
  if (dp[p].ch == 0 || (dp[p].x1 == 0 && dp[p].x2 == 0)) return;
  dp[p].val += (dp[p].x1 * pr1[dp[p].ch]) % 1000000009;
  dp[p].val %= 1000000009;
  dp[p].val += (dp[p].x2 * pr2[dp[p].ch]) % 1000000009;
  dp[p].val %= 1000000009;
  dp[2 * p].x1 += dp[p].x1;
  dp[2 * p].x1 %= 1000000009;
  dp[2 * p].x2 += dp[p].x2;
  dp[2 * p].x2 %= 1000000009;
  dp[2 * p + 1].x1 += (dp[p].x1 * fi1[dp[2 * p].ch + 1]) % 1000000009;
  dp[2 * p + 1].x1 %= 1000000009;
  dp[2 * p + 1].x1 += (dp[p].x2 * fi2[dp[2 * p].ch + 1]) % 1000000009;
  dp[2 * p + 1].x1 %= 1000000009;
  dp[2 * p + 1].x2 += (dp[p].x1 * fi1[dp[2 * p].ch + 2]) % 1000000009;
  dp[2 * p + 1].x2 %= 1000000009;
  dp[2 * p + 1].x2 += (dp[p].x2 * fi2[dp[2 * p].ch + 2]) % 1000000009;
  dp[2 * p + 1].x2 %= 1000000009;
  dp[p].x1 = 0;
  dp[p].x2 = 0;
}
void add(int a, int b, long long x1, long long x2, int l = 1, int h = n,
         int p = 1) {
  if (l == h) {
    dp[p].ch = 1;
  }
  update(p);
  if (a == l && b == h) {
    dp[p].x1 = x1;
    dp[p].x2 = x2;
    update(p);
    return;
  }
  int m = (l + h) / 2;
  if (b <= m) {
    add(a, b, x1, x2, l, m, 2 * p);
  } else if (a > m) {
    add(a, b, x1, x2, m + 1, h, 2 * p + 1);
  } else {
    add(a, m, x1, x2, l, m, 2 * p);
    long long x3 = (x1 * fi1[m - a + 2]) % 1000000009;
    x3 += (x2 * fi2[m - a + 2]) % 1000000009;
    x3 %= 1000000009;
    long long x4 = (x1 * fi1[m - a + 3]) % 1000000009;
    x4 += (x2 * fi2[m - a + 3]) % 1000000009;
    x4 %= 1000000009;
    add(m + 1, b, x3, x4, m + 1, h, 2 * p + 1);
  }
  update(2 * p);
  update(2 * p + 1);
  dp[p].ch = dp[2 * p].ch + dp[2 * p + 1].ch;
  dp[p].val = dp[2 * p].val + dp[2 * p + 1].val;
  dp[p].val %= 1000000009;
}
long long cal(int a, int b, long long x1 = 0, long long x2 = 0, int l = 1,
              int h = n, int p = 1) {
  update(p);
  if (a == l && b == h) {
    return dp[p].val;
  }
  int m = (l + h) / 2;
  if (b <= m) {
    return cal(a, b, x1, x2, l, m, 2 * p);
  } else if (a > m) {
    return cal(a, b, x1, x2, m + 1, h, 2 * p + 1);
  } else {
    return (cal(a, m, x1, x2, l, m, 2 * p) +
            cal(m + 1, b, x1, x2, m + 1, h, 2 * p + 1)) %
           1000000009;
  }
}
long long a[300300];
int main() {
  fi1[1] = 1;
  fi2[1] = 0;
  fi1[2] = 0;
  fi2[2] = 1;
  for (int i = 3; i < 300300; i++) {
    fi1[i] = fi1[i - 2] + fi1[i - 1];
    fi1[i] %= 1000000009;
    fi2[i] = fi2[i - 2] + fi2[i - 1];
    fi2[i] %= 1000000009;
  }
  for (int i = 1; i < 300300; i++) {
    pr1[i] = pr1[i - 1] + fi1[i];
    pr1[i] %= 1000000009;
    pr2[i] = pr2[i - 1] + fi2[i];
    pr2[i] %= 1000000009;
  }
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    add(i, i, a[i], 0);
  }
  int t, l, r;
  while (m--) {
    scanf("%d%d%d", &t, &l, &r);
    if (t == 1) {
      add(l, r, 1, 1);
    } else {
      printf("%I64d\n", cal(l, r));
    }
  }
  return 0;
}
