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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            CDZYLovesFibonacciNumbers solver = new CDZYLovesFibonacciNumbers();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class CDZYLovesFibonacciNumbers {
        int mod = (int) 1e9 + 9;

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.ri();
            int m = in.ri();
            int[] a = in.ri(n);
            Segment st = new Segment(0, n - 1, i -> a[i]);
            for (int i = 0; i < m; i++) {
                int t = in.ri();
                int l = in.ri() - 1;
                int r = in.ri() - 1;
                if (t == 1) {
                    long[][] vec = new long[][]{{1}, {1}};
                    Modify mod = new Modify();
                    mod.data = vec;
                    st.update(l, r, 0, n - 1, mod);
                } else {
                    long sum = st.query(l, r, 0, n - 1) % mod;
                    out.println(sum);
                }
            }
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private static final int THRESHOLD = 32 << 10;
        private final Writer os;
        private StringBuilder cache = new StringBuilder(THRESHOLD * 2);

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        private void afterWrite() {
            if (cache.length() < THRESHOLD) {
                return;
            }
            flush();
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput append(long c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput println(long c) {
            return append(c).println();
        }

        public FastOutput println() {
            return append('\n');
        }

        public FastOutput flush() {
            try {
//            boolean success = false;
//            if (stringBuilderValueField != null) {
//                try {
//                    char[] value = (char[]) stringBuilderValueField.get(cache);
//                    os.write(value, 0, cache.length());
//                    success = true;
//                } catch (Exception e) {
//                }
//            }
//            if (!success) {
                os.append(cache);
//            }
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class DigitUtils {
        private DigitUtils() {
        }

        public static int floorAverage(int x, int y) {
            return (x & y) + ((x ^ y) >> 1);
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        public void populate(int[] data) {
            for (int i = 0; i < data.length; i++) {
                data[i] = readInt();
            }
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int ri() {
            return readInt();
        }

        public int[] ri(int n) {
            int[] ans = new int[n];
            populate(ans);
            return ans;
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class Segment implements Cloneable {
        private static long mod = (int) 1e9 + 9;
        private Segment left;
        private Segment right;
        private long[][] sumVec;
        private long[][] move;
        private long[][] vec;
        private long sum;

        private static long[][] mul(long[][] a, long[][] b) {
            int n = a.length;
            int m = b[0].length;
            int mid = a[0].length;
            assert a[0].length == b.length;
            long[][] ans = new long[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    for (int k = 0; k < mid; k++) {
                        ans[i][j] += a[i][k] * b[k][j];
                    }
                    ans[i][j] %= mod;
                }
            }
            return ans;
        }

        private static void mulAndStore(long[][] a, long[][] b) {
            long x = b[0][0];
            long y = b[1][0];
            b[0][0] = (a[0][0] * x + a[0][1] * y) % mod;
            b[1][0] = (a[1][0] * x + a[1][1] * y) % mod;
        }

        private static long[][] sum(long[][] a, long[][] b) {
            int n = a.length;
            int m = a[0].length;
            long[][] ans = new long[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    ans[i][j] = a[i][j] + b[i][j];
                    if (ans[i][j] >= mod) {
                        ans[i][j] -= mod;
                    }
                }
            }
            return ans;
        }

        private static long mulVec(long[][] a, long[][] b) {
            assert a.length == 1 && b[0].length == 1;
            long ans = a[0][0] * b[0][0] + a[0][1] * b[1][0];
            ans %= mod;
            return ans;
        }

        private void modify(long[][] dirty) {
            sum += mulVec(sumVec, dirty);
            if (sum >= mod) {
                sum -= mod;
            }
            for (int i = 0; i < 2; i++) {
                vec[i][0] += dirty[i][0];
                if (vec[i][0] >= mod) {
                    vec[i][0] -= mod;
                }
            }
        }

        public void pushUp() {
            sum = left.sum + right.sum;
            if (sum >= mod) {
                sum -= mod;
            }
        }

        public void firstPushUp() {
            move = mul(right.move, left.move);
            sumVec = sum(left.sumVec, mul(right.sumVec, left.move));
            vec = new long[][]{{0}, {0}};
        }

        public void pushDown() {
            if (vec[0][0] != 0 || vec[1][0] != 0) {
                //pushdown
                left.modify(vec);
                mulAndStore(left.move, vec);
                right.modify(vec);
                vec[0][0] = vec[1][0] = 0;
            }
        }

        public Segment(int l, int r, IntToIntegerFunction func) {
            if (l < r) {
                int m = DigitUtils.floorAverage(l, r);
                left = new Segment(l, m, func);
                right = new Segment(m + 1, r, func);
                firstPushUp();
                pushUp();
            } else {
                sumVec = new long[][]{{1, 0}};
                vec = new long[][]{{0}, {0}};
                move = new long[][]{{0, 1}, {1, 1}};
                sum = func.apply(l);
            }
        }

        private boolean enter(int L, int R, int l, int r) {
            return L <= l && R >= r;
        }

        private boolean leave(int L, int R, int l, int r) {
            return L > r || R < l;
        }

        public void update(int L, int R, int l, int r, Modify modify) {
            if (leave(L, R, l, r)) {
                return;
            }
            if (enter(L, R, l, r)) {
                modify(modify.data);
                mulAndStore(move, modify.data);
                return;
            }
            pushDown();
            int m = DigitUtils.floorAverage(l, r);
            left.update(L, R, l, m, modify);
            right.update(L, R, m + 1, r, modify);
            pushUp();
        }

        public long query(int L, int R, int l, int r) {
            if (leave(L, R, l, r)) {
                return 0;
            }
            if (enter(L, R, l, r)) {
                return sum;
            }
            pushDown();
            int m = DigitUtils.floorAverage(l, r);
            return left.query(L, R, l, m) +
                    right.query(L, R, m + 1, r);
        }

        private Segment deepClone() {
            Segment seg = clone();
            if (seg.left != null) {
                seg.left = seg.left.deepClone();
            }
            if (seg.right != null) {
                seg.right = seg.right.deepClone();
            }
            return seg;
        }

        protected Segment clone() {
            try {
                return (Segment) super.clone();
            } catch (CloneNotSupportedException e) {
                throw new RuntimeException(e);
            }
        }

        private void toString(StringBuilder builder) {
            if (left == null && right == null) {
                builder.append("val").append(",");
                return;
            }
            pushDown();
            left.toString(builder);
            right.toString(builder);
        }

        public String toString() {
            StringBuilder builder = new StringBuilder();
            deepClone().toString(builder);
            if (builder.length() > 0) {
                builder.setLength(builder.length() - 1);
            }
            return builder.toString();
        }

    }

    static class Modify {
        long[][] data;

    }

    static interface IntToIntegerFunction {
        int apply(int x);

    }
}

