Lee tried so hard to make a good div.2 D problem to balance his recent contest, but it still doesn't feel good at all. Lee invented it so tediously slow that he managed to develop a phobia about div.2 D problem setting instead. And now he is hiding behind the bushes...

Let's define a Rooted Dead Bush (RDB) of level n as a rooted tree constructed as described below.

A rooted dead bush of level 1 is a single vertex. To construct an RDB of level i we, at first, construct an RDB of level i-1, then for each vertex u: 

  * if u has no children then we will add a single child to it; 
  * if u has one child then we will add two children to it; 
  * if u has more than one child, then we will skip it. 

<image> Rooted Dead Bushes of level 1, 2 and 3.

Let's define a claw as a rooted tree with four vertices: one root vertex (called also as center) with three children. It looks like a claw:

<image> The center of the claw is the vertex with label 1.

Lee has a Rooted Dead Bush of level n. Initially, all vertices of his RDB are green.

In one move, he can choose a claw in his RDB, if all vertices in the claw are green and all vertices of the claw are children of its center, then he colors the claw's vertices in yellow.

He'd like to know the maximum number of yellow vertices he can achieve. Since the answer might be very large, print it modulo 10^9+7.

Input

The first line contains one integer t (1 ≤ t ≤ 10^4) — the number of test cases.

Next t lines contain test cases — one per line.

The first line of each test case contains one integer n (1 ≤ n ≤ 2 ⋅ 10^6) — the level of Lee's RDB.

Output

For each test case, print a single integer — the maximum number of yellow vertices Lee can make modulo 10^9 + 7.

Example

Input


7
1
2
3
4
5
100
2000000


Output


0
0
4
4
12
990998587
804665184

Note

It's easy to see that the answer for RDB of level 1 or 2 is 0.

The answer for RDB of level 3 is 4 since there is only one claw we can choose: \{1, 2, 3, 4\}.

The answer for RDB of level 4 is 4 since we can choose either single claw \{1, 3, 2, 4\} or single claw \{2, 7, 5, 6\}. There are no other claws in the RDB of level 4 (for example, we can't choose \{2, 1, 7, 6\}, since 1 is not a child of center vertex 2).

<image> Rooted Dead Bush of level 4.
import java.io.*;
import java.util.*;

public class D {

    static final int MOD = 1000000007;
    static final int MAX_N = 2000000;

    void solve() throws IOException {
        in = new InputReader("__std");
        out = new OutputWriter("__std");

        int[] cnt = new int[MAX_N + 1];
        int v = 1;
        for (int i = 3; i <= MAX_N; ++i) {
            cnt[i] = cnt[i - 3] + v;
            if (cnt[i] >= MOD) cnt[i] -= MOD;
            v = (v << 1) + ((i & 1) == 0 ? 1 : -1);
            if (v < 0) v += MOD;
            if (v >= MOD) v -= MOD;
        }

        int testCount = in.readInt();
        for (int test = 1; test <= testCount; ++test) {
            int n = in.readInt();
            out.println(4L * cnt[n] % MOD);
        }

        exit();
    }

    void exit() {
        out.close();
        //System.err.println((System.currentTimeMillis() - startTime) + " ms");
        System.exit(0);
    }

    InputReader in;
    OutputWriter out;

    //long startTime = System.currentTimeMillis();

    public static void main(String[] args) throws IOException {
        new D().solve();
    }

    class InputReader {

        private InputStream stream;

        private byte[] buffer = new byte[1024];
        private int pos, len;

        private int cur;

        private StringBuilder sb = new StringBuilder(32);

        InputReader(String name) throws IOException {
            if (name.equals("__std")) {
                stream = System.in;
            } else {
                stream = new FileInputStream(name);
            }
            cur = read();
        }

        private int read() throws IOException {
            if (len == -1) {
                throw new EOFException();
            }
            if (pos >= len) {
                pos = 0;
                len = stream.read(buffer);
                if (len == -1) return -1;
            }
            return buffer[pos++] & 0xff;
        }

        boolean whitespace() {
            return cur == ' ' || cur == '\t' || cur == '\r' || cur == '\n' || cur == -1;
        }

        boolean eol() {
            return cur == '\r' || cur == '\n' || cur == -1;
        }

        boolean eof() {
            return cur == -1;
        }

        byte readByte() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            byte res = (byte) cur;
            cur = read();
            return res;
        }

        char readChar() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            char res = (char) cur;
            cur = read();
            return res;
        }

        int readInt() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            while (whitespace()) {
                cur = read();
            }
            if (eof()) {
                throw new EOFException();
            }
            int sign = 1;
            if (cur == '-') {
                sign = -1;
                cur = read();
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
            }
            int res = 0;
            while (!whitespace()) {
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
                res *= 10;
                res += cur - '0';
                cur = read();
            }
            return res * sign;
        }

        long readLong() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            while (whitespace()) {
                cur = read();
            }
            if (eof()) {
                throw new EOFException();
            }
            int sign = 1;
            if (cur == '-') {
                sign = -1;
                cur = read();
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
            }
            long res = 0;
            while (!whitespace()) {
                if (cur < '0' || cur > '9') {
                    throw new NumberFormatException();
                }
                res *= 10;
                res += cur - '0';
                cur = read();
            }
            return res * sign;
        }

        double readDouble() throws IOException {
            return Double.parseDouble(readToken());
        }

        String readToken() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            while (whitespace()) {
                cur = read();
            }
            if (eof()) {
                throw new EOFException();
            }
            sb.setLength(0);
            while (!whitespace()) {
                sb.append((char) cur);
                cur = read();
            }
            return sb.toString();
        }

        String readLine() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            sb.setLength(0);
            while (!eol()) {
                sb.append((char) cur);
                cur = read();
            }
            if (cur == '\r') {
                cur = read();
            }
            if (cur == '\n') {
                cur = read();
            }
            return sb.toString();
        }

        void skipLine() throws IOException {
            if (eof()) {
                throw new EOFException();
            }
            while (!eol()) {
                cur = read();
            }
            if (cur == '\r') {
                cur = read();
            }
            if (cur == '\n') {
                cur = read();
            }
        }
    }

    class OutputWriter {

        private PrintWriter writer;

        OutputWriter(String name) throws IOException {
            if (name.equals("__std")) {
                writer = new PrintWriter(System.out);
            } else {
                writer = new PrintWriter(name);
            }
        }

        void print(String format, Object ... args) {
            writer.print(new Formatter(Locale.US).format(format, args));
        }

        void println(String format, Object ... args) {
            writer.println(new Formatter(Locale.US).format(format, args));
        }

        void print(Object value) {
            writer.print(value);
        }

        void println(Object value) {
            writer.println(value);
        }

        void println() {
            writer.println();
        }

        void printArray(int[] a) {
            boolean first = true;
            for (int v : a) {
                if (!first) {
                    writer.print(' ');
                } else {
                    first = false;
                }
                writer.print(v);
            }
            writer.println();
        }

        void printArray(int[][] a) {
            for (int[] v : a) {
                printArray(v);
            }
        }

        void flush() {
            writer.flush();
        }

        void close() {
            writer.close();
        }
    }
}
