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.
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Rubanenko
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskC {

    final int MD = 1000000000 + 9;

    int sz, n;
    int[] a1, a2, sum, fib, sumFib;

    int getPrefixSum(int a1, int a2, int n) {
        if (n == 1) return a1;
        if (n == 2) return (a1 + a2) % MD;
        long res = (((long)a1 * fib[n] + (long)a2 * sumFib[n - 1]) % MD);
        return (int) res;
    }

    int getNthElement(int a1, int a2, int n) {
        if (n == 1) return a1;
        if (n == 2) return a2;
        long res = (((long)fib[n - 2] * a1 + (long)fib[n - 1] * a2) % MD);
        return (int) res;
    }

    void push(int v, int l, int r) {
        a1[v << 1] += a1[v];
        if (a1[v << 1] >= MD) a1[v << 1] -= MD;
        a2[v << 1] += a2[v];
        if (a2[v << 1] >= MD) a2[v << 1] -= MD;
//        System.err.println((v * 2 + 1) + " a1 " + getNthElement(a1[v], a2[v], ((r - l + 1) >> 1) + 1));
//        System.err.println((v * 2 + 1) + " a2 " + getNthElement(a1[v], a2[v], ((r - l + 1) >> 1) + 2));
        a1[(v << 1) + 1] += getNthElement(a1[v], a2[v], ((r - l + 1) >> 1) + 1);
        a2[(v << 1) + 1] += getNthElement(a1[v], a2[v], ((r - l + 1) >> 1) + 2);
        if (a1[(v << 1) + 1] >= MD) a1[(v << 1) + 1] -= MD;
        if (a2[(v << 1) + 1] >= MD) a2[(v << 1) + 1] -= MD;
        a1[v] = 0;
        a2[v] = 0;
    }

    int getVertexSum(int v, int l, int r) {
        if (r > n) r = n;
        if (l > r) return 0;
        return (sum[v] + getPrefixSum(a1[v], a2[v], (r - l + 1))) % MD;
    }

    void upd(int v, int tl, int tr, int l, int r) {
        if (tl > r || l > tr) return;
        if (l <= tl && r >= tr) {
            a1[v] += fib[tl - l + 1];
            if (a1[v] >= MD) a1[v] -= MD;
            a2[v] += fib[tl - l + 2];
            if (a2[v] >= MD) a2[v] -= MD;
            return;
        }
        push(v, tl, tr);
        int c = (tl + tr) >> 1;
        upd(v << 1, tl, c, l, r);
        upd((v << 1) + 1, c + 1, tr, l, r);
        sum[v] = getVertexSum(v << 1, tl, c) + getVertexSum((v << 1) + 1, c + 1, tr);
        if (sum[v] >= MD) sum[v] -= MD;
    }

    int get(int v, int tl, int tr, int l, int r) {
        if (tl > r || l > tr) return 0;
        if (l <= tl && r >= tr) {
           // if (r == 41) System.err.println(v + " " + tl + " " + tr);
            return getVertexSum(v, tl, tr);
        }
        push(v, tl, tr);
        int c = (tl + tr) >> 1;
        int res = get(v << 1, tl, c, l, r) + get((v << 1) + 1, c + 1, tr, l, r);
        if (res >= MD) res -= MD;
        sum[v] = getVertexSum(v << 1, tl, c) + getVertexSum((v << 1) + 1, c + 1, tr);
        if (sum[v] >= MD) sum[v] -= MD;
        return res;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        n = in.nextInt();
        int m = in.nextInt();
        sz = 1;
        while (sz < n) {
            sz *= 2;
        }
     //   sz = 128;
        fib = new int[sz + 2];
        sumFib = new int[sz + 2];
        fib[1] = 1;
        fib[2] = 1;
        sumFib[1] = 1;
        sumFib[2] = 2;
        for (int i = 3; i <= sz + 1; i++) {
            fib[i] = fib[i - 1] + fib[i - 2];
            if (fib[i] >= MD) fib[i] -= MD;
            sumFib[i] = sumFib[i - 1] + fib[i];
            if (sumFib[i] >= MD) sumFib[i] -= MD;
        }
        a1 = new int[sz * 2];
        a2 = new int[sz * 2];
        sum = new int[sz * 2];
        for (int i = 0; i < n; i++) {
            sum[i + sz] = in.nextInt();
        }
        for (int i = sz - 1; i > 0; i--) {
            sum[i] = sum[i << 1] + sum[(i << 1) + 1];
            if (sum[i] >= MD) sum[i] -= MD;
        }

//        upd(1, 1, sz, 1, 43);
//        for (int i = 41; i <= 41; i++) {
//            int x = get(1, 1, sz, i, i);
//            if (x != fib[i]) {
//                out.println("pizdos " + i + " " + x + " " + fib[i]);
//                out.println(a1[168] + " " + a2[168]);
//                out.println(getNthElement(1, 1, 41));
//                return;
//            }
//        }
//        if (n < 1000000) return;
        for (int i = 0; i < m; i++) {
            int t = in.nextInt();
            int l = in.nextInt();
            int r = in.nextInt();
            if (t == 1) upd(1, 1, sz, l, r);
            else out.println(get(1, 1, sz, l, r));
        }

    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        reader = new BufferedReader(new InputStreamReader(inputStream));
    }

    public String nextLine() {
        String line = null;
        try {
            line = reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return line;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens())
            tokenizer = new StringTokenizer(nextLine());
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
}

