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;
const int N = 2;
struct Matrix {
  int mat[N][N];
  void init() { memset(mat, 0, sizeof(mat)); }
};
Matrix tot[350000];
Matrix qn[350000];
Matrix q, a0;
Matrix rr[350000 * 3];
int seq[350000 * 3];
int v[350000 * 3];
long long sum[350000];
Matrix operator*(Matrix a, Matrix b) {
  Matrix c;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      long long temp = 0;
      for (int k = 0; k < N; ++k) {
        temp = temp + (long long)a.mat[i][k] * b.mat[k][j];
      }
      c.mat[i][j] = temp % 1000000009;
    }
  }
  return c;
}
Matrix operator+(Matrix a, Matrix b) {
  Matrix c;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      c.mat[i][j] = (a.mat[i][j] + b.mat[i][j]) % 1000000009;
    }
  }
  return c;
}
void init() {
  Matrix c;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      c.mat[i][j] = (i == j);
    }
  }
  qn[0] = c;
  tot[0].init();
  for (int i = 1; i < 350000; i++) {
    qn[i] = qn[i - 1] * q;
    tot[i] = tot[i - 1] + qn[i] * a0;
  }
}
void pushdown(int tt, int l, int r) {
  int mid = (l + r) / 2;
  if (v[tt] && l != r) {
    rr[tt * 2] = rr[tt * 2] + rr[tt];
    seq[tt * 2] =
        (seq[tt * 2] + (rr[tt] * tot[mid - l + 1]).mat[0][0]) % 1000000009;
    v[tt * 2] = 1;
    rr[tt * 2 + 1] = rr[tt * 2 + 1] + qn[mid + 1 - l] * rr[tt];
    seq[tt * 2 + 1] = (seq[tt * 2 + 1] +
                       (rr[tt] * qn[mid + 1 - l] * tot[r - mid]).mat[0][0]) %
                      1000000009;
    v[tt * 2 + 1] = 1;
    rr[tt].init();
  }
  v[tt] = -1;
}
void update(int l, int r, int tt, int x, int y, int st) {
  if (x == l && y == r) {
    v[tt] = 1;
    rr[tt] = rr[tt] + qn[st];
    seq[tt] = (seq[tt] + (qn[st] * tot[r - l + 1]).mat[0][0]) % 1000000009;
    return;
  }
  int mid = (l + r) / 2;
  pushdown(tt, l, r);
  if (y <= mid) {
    update(l, mid, tt * 2, x, y, st);
  } else if (x > mid) {
    update(mid + 1, r, tt * 2 + 1, x, y, st);
  } else {
    update(l, mid, tt * 2, x, mid, st);
    update(mid + 1, r, tt * 2 + 1, mid + 1, y, st + mid - x + 1);
  }
  seq[tt] = (seq[tt * 2] + seq[tt * 2 + 1]) % 1000000009;
}
long long query(int l, int r, int tt, int x, int y) {
  if (x == l && y == r) {
    return seq[tt];
  }
  int mid = (l + r) / 2;
  pushdown(tt, l, r);
  if (y <= mid) {
    return query(l, mid, tt * 2, x, y);
  } else if (x > mid) {
    return query(mid + 1, r, tt * 2 + 1, x, y);
  } else {
    return (query(l, mid, tt * 2, x, mid) +
            query(mid + 1, r, tt * 2 + 1, mid + 1, y)) %
           1000000009;
  }
}
int main() {
  a0.mat[0][0] = 0;
  a0.mat[1][0] = 1;
  a0.mat[1][1] = 0;
  a0.mat[0][1] = 0;
  q.mat[1][0] = 1;
  q.mat[1][1] = 0;
  q.mat[0][0] = 1;
  q.mat[0][1] = 1;
  init();
  int n, m, l, r, k;
  memset(rr, 0, sizeof(rr));
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &sum[i]);
    sum[i] = (sum[i] + sum[i - 1]) % 1000000009;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d%d", &k, &l, &r);
    if (k == 1) {
      update(1, n, 1, l, r, 0);
    } else {
      printf("%lld\n", ((sum[r] - sum[l - 1] +
                         query(1, n, 1, l, r) % 1000000009 + 1000000009) %
                        1000000009));
    }
  }
  return 0;
}
