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;
int a[312345], seg[4 * 300000 + 29];
int mat[300045][3][3];
pair<int, int> lazy[4 * 300000 + 29];
int build(int node, int s, int e) {
  if (s == e) {
    seg[node] = a[s];
    return 0;
  }
  int mid = (s + e) / 2;
  build(2 * node, s, mid);
  build(2 * node + 1, mid + 1, e);
  seg[node] = seg[2 * node] + seg[2 * node + 1];
  if (seg[node] >= (1000 * 1000 * 1000 + 9))
    seg[node] -= (1000 * 1000 * 1000 + 9);
  return 0;
}
pair<int, int> updatelazy(int node, int s, int e) {
  pair<int, int> haha;
  int mid = (s + e) / 2;
  long long val = 1LL * lazy[node].first * mat[(e - s + 1)][0][1];
  val %= (1000 * 1000 * 1000 + 9);
  val += 1LL * lazy[node].second * mat[(e - s + 1)][0][2];
  val %= (1000 * 1000 * 1000 + 9);
  seg[node] += val;
  if (seg[node] >= (1000 * 1000 * 1000 + 9)) {
    seg[node] -= (1000 * 1000 * 1000 + 9);
  }
  mid++;
  mid -= s;
  if (s == e) {
    return haha;
  }
  val = 1LL * lazy[node].first * mat[mid][1][1] +
        1LL * lazy[node].second * mat[mid][1][2];
  val %= (1000 * 1000 * 1000 + 9);
  haha.first = val;
  val = 1LL * lazy[node].first * mat[mid][2][1] +
        1LL * lazy[node].second * mat[mid][2][2];
  val %= (1000 * 1000 * 1000 + 9);
  haha.second = val;
  return haha;
}
pair<int, int> getval(int l, int s) {
  s -= l;
  if (s == 0) {
    return make_pair(1, 0);
  }
  pair<int, int> haha;
  haha.first = mat[s][1][1];
  haha.second = mat[s][2][1];
  return haha;
}
int add(pair<int, int> &a, pair<int, int> b) {
  a.first += b.first;
  if (a.first >= (1000 * 1000 * 1000 + 9)) {
    a.first -= (1000 * 1000 * 1000 + 9);
  }
  a.second += b.second;
  if (a.second >= (1000 * 1000 * 1000 + 9)) {
    a.second -= (1000 * 1000 * 1000 + 9);
  }
  return 0;
}
int query(int node, int s, int e, int l, int r) {
  pair<int, int> haha;
  if (lazy[node] != make_pair(0, 0)) {
    haha = updatelazy(node, s, e);
    if (s != e) {
      add(lazy[2 * node], lazy[node]);
      add(lazy[2 * node + 1], haha);
      lazy[node] = make_pair(0, 0);
    } else {
      lazy[node] = make_pair(0, 0);
    }
  }
  if (l > e || r < s) {
    return 0;
  }
  if (l <= s && e <= r) {
    return seg[node];
  }
  int mid = (s + e) / 2;
  int aa = query(2 * node, s, mid, l, r);
  int ab = query(2 * node + 1, mid + 1, e, l, r);
  if (aa + ab >= (1000 * 1000 * 1000 + 9)) {
    return (aa + ab - (1000 * 1000 * 1000 + 9));
  } else {
    return (aa + ab);
  }
  return 0;
}
int update(int node, int s, int e, int l, int r) {
  pair<int, int> haha;
  if (lazy[node] != make_pair(0, 0)) {
    haha = updatelazy(node, s, e);
    if (s != e) {
      add(lazy[2 * node], lazy[node]);
      add(lazy[2 * node + 1], haha);
      lazy[node] = make_pair(0, 0);
    } else {
      lazy[node] = make_pair(0, 0);
    }
  }
  if (l > e || r < s) {
    return 0;
  }
  if (l <= s && e <= r) {
    haha = getval(l, s);
    add(lazy[node], haha);
    if (lazy[node] != make_pair(0, 0)) {
      haha = updatelazy(node, s, e);
      if (s != e) {
        add(lazy[2 * node], lazy[node]);
        add(lazy[2 * node + 1], haha);
        lazy[node] = make_pair(0, 0);
      } else {
        lazy[node] = make_pair(0, 0);
      }
    }
    return 0;
  }
  int mid = (s + e) / 2;
  update(2 * node, s, mid, l, r);
  update(2 * node + 1, mid + 1, e, l, r);
  seg[node] = seg[2 * node] + seg[2 * node + 1];
  if (seg[node] >= (1000 * 1000 * 1000 + 9))
    seg[node] -= (1000 * 1000 * 1000 + 9);
  return 0;
}
int pre(int n) {
  long long base[3][3] = {0};
  base[0][0] = base[0][1] = base[1][1] = base[1][2] = base[2][1] = 1;
  int i, j, p, q, r, k;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      mat[1][i][j] = base[i][j];
    }
  }
  long long lol[3][3] = {0};
  for (i = 2; i < n + 10; i++) {
    for (p = 0; p < 3; p++) {
      for (q = 0; q < 3; q++) {
        for (r = 0; r < 3; r++) {
          lol[p][q] += base[p][r] * mat[i - 1][r][q];
          lol[p][q] %= (1000 * 1000 * 1000 + 9);
        }
      }
    }
    for (p = 0; p < 3; p++) {
      for (q = 0; q < 3; q++) {
        mat[i][p][q] = lol[p][q];
        lol[p][q] = 0;
      }
    }
  }
  return 0;
}
int main() {
  std::ios::sync_with_stdio(false);
  int n, m, i, t, l, r;
  cin >> n >> m;
  pre(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < 4 * n + 12; i++) {
    lazy[i] = make_pair(0, 0);
    seg[i] = 0;
  }
  build(1, 0, n - 1);
  while (m--) {
    cin >> t >> l >> r;
    l--;
    r--;
    if (t == 1) {
      update(1, 0, n - 1, l, r);
    } else {
      cout << query(1, 0, n - 1, l, r) << endl;
    }
  }
  return 0;
}
