Problem: You are given an array a of length n consisting of zeros. You perform n actions with this array: during the i-th action, the following sequence of operations appears:

  1. Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftmost one; 
  2. Let this segment be [l; r]. If r-l+1 is odd (not divisible by 2) then assign (set) a[(l+r)/(2)] := i (where i is the number of the current action), otherwise (if r-l+1 is even) assign (set) a[(l+r-1)/(2)] := i. 



Consider the array a of length 5 (initially a=[0, 0, 0, 0, 0]). Then it changes as follows:

  1. Firstly, we choose the segment [1; 5] and assign a[3] := 1, so a becomes [0, 0, 1, 0, 0]; 
  2. then we choose the segment [1; 2] and assign a[1] := 2, so a becomes [2, 0, 1, 0, 0]; 
  3. then we choose the segment [4; 5] and assign a[4] := 3, so a becomes [2, 0, 1, 3, 0]; 
  4. then we choose the segment [2; 2] and assign a[2] := 4, so a becomes [2, 4, 1, 3, 0]; 
  5. and at last we choose the segment [5; 5] and assign a[5] := 5, so a becomes [2, 4, 1, 3, 5]. 



Your task is to find the array a of length n after performing all n actions. Note that the answer exists and unique.

You have to answer t independent test cases.

Input

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

The only line of the test case contains one integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the length of a.

It is guaranteed that the sum of n over all test cases does not exceed 2 ⋅ 10^5 (∑ n ≤ 2 ⋅ 10^5).

Output

For each test case, print the answer — the array a of length n after performing n actions described in the problem statement. Note that the answer exists and unique.

Example

Input


6
1
2
3
4
5
6


Output


1 
1 2 
2 1 3 
3 1 2 4 
2 4 1 3 5 
3 4 1 5 2 6 

Solution (in JAVA):

Solution:
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;
import java.util.Vector;
import java.util.function.Function;
import java.util.stream.Collectors;

import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.pow;
import static java.lang.Math.abs;
import static java.lang.Math.ceil;
import static java.lang.Math.floor;
import static java.util.Arrays.fill;
import static java.util.Arrays.sort;
import static java.util.Arrays.parallelSort;
import static java.util.Arrays.binarySearch;

public class cfa {

    static final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    static final int MOD = (int) (1e9 + 7);
    static final int MOD_FFT = 998244353;
    static final Reader r = new Reader();
    static final PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
    static Vector<Integer> adj[], v;
    static{
        
    }

    public static void main(final String[] args) throws Exception {
        new Thread(null, new Runnable() {
            @Override
            public void run() {
                try {
                    final int testcases = HAS_TEST_CASES ? ni() : 1;
                    for (int i = 1; i <= testcases; i++) {
                        // out.print("Case #" + (i + 1) + ": ");
                        try {
                            solve();
                        } catch (final Exception e) {
                            pn(e.getMessage());
                            pni("idk Exception");
                            e.printStackTrace(System.err);
                        }
                    }
                    out.flush();
                } catch (Throwable t) {
                    t.printStackTrace(System.err);
                    System.exit(-1);
                }

            }

        }, "", (1L << 1)).start();
        // final int testcases = HAS_TEST_CASES ? ni() : 1;
        // for (int i = 1; i <= testcases; i++) {
        //     // out.print("Case #" + (i + 1) + ": ");
        //     try {
        //         solve();
        //     } catch (final ArrayIndexOutOfBoundsException e) {
        //         e.printStackTrace();
        //     } catch (final Exception e) {
        //         pni("idk Exception in solve");
        //         e.printStackTrace();
        //     }
        // }
        // out.flush();
    }

    static final boolean HAS_TEST_CASES = true, FASTIO = true;
    static final int SCAN_LINE_LENGTH = 1000002;

    static int n, a[], e[][];

    static void solve() throws IOException {
        n = ni();
        a = new int[n];
        final PriorityQueue<Pair<Integer, pi>> ts = new PriorityQueue<>();
        add(ts, -n, 0, n - 1);
        int num = 1;
        while (!ts.isEmpty() && num <= n) {
            final Pair<Integer, pi> p = ts.poll();
            final int l = p.snd.fir, r = p.snd.snd, m = (l + r) / 2;
            a[m] = num++;
            if (n > 1) {
                add(ts, m - l, l, m - 1);
            }
            add(ts, r - m, m + 1, r);
        }
        for (int i = 0; i < a.length; i++) {
            p(a[i] + " ");
        }
        pn();
    }

    private static void add(final PriorityQueue<Pair<Integer, pi>> ts, final int s, final int l, final int r) {
        final pi pp = new pi(l, r);
        final Pair<Integer, pi> p = new Pair<>(-s, pp);
        ts.add(p);
    }

    private static void swap(final int i, final int j) {
        final int temp = a[i];
        a[i] = a[j];
        a[j] = temp;
    }

    static boolean isMulOverflow(final long A, final long B) {
        if (A == 0 || B == 0)
            return false;
        final long result = A * B;
        if (A == result / B)
            return true;
        return false;
    }

    private static int gcd(final int a, final int b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    static class pi implements Comparable<pi> {
        int fir, snd;

        pi() {

        }

        pi(final int x, final int y) {
            fir = x;
            snd = y;
        }

        public int compareTo(final pi o) {
            return fir == o.fir ? snd - o.snd : fir - o.fir;
        }

    }

    static class Pair<T, E> implements Comparable<Pair<T, E>> {
        T fir;
        E snd;

        Pair() {

        }

        Pair(final T x, final E y) {
            this.fir = x;
            this.snd = y;
        }

        @Override
        @SuppressWarnings("unchecked")
        public int compareTo(final Pair<T, E> o) {
            final int c = ((Comparable<T>) fir).compareTo(o.fir);
            return c != 0 ? c : ((Comparable<E>) snd).compareTo(o.snd);
        }

    }

    private static <T> void checkV(final Vector<T> adj[], final int i) {
        adj[i] = adj[i] == null ? new Vector<>() : adj[i];
    }

    private static int[] na(final int n) throws Exception {
        final int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = ni();
        }
        return a;
    }

    private static int[] na1(final int n) throws Exception {
        final int[] a = new int[n + 1];
        for (int i = 1; i < a.length; i++) {
            a[i] = ni();
        }
        return a;
    }

    private static String n() throws Exception {
        return FASTIO ? r.readToken() : in.next();
    }

    private static String nln() throws Exception {
        return FASTIO ? r.readLine() : in.nextLine();
    }

    private static int ni() throws IOException {
        return FASTIO ? r.nextInt() : in.nextInt();
    }

    private static long nl() throws Exception {
        return FASTIO ? r.nextLong() : in.nextLong();
    }

    private static double nd() throws Exception {
        return FASTIO ? r.nextDouble() : in.nextDouble();
    }

    private static void p(final Object o) {
        out.print(o);
    }

    private static void pn(final Object o) {
        out.println(o);
    }

    private static void pn() {
        out.println("");
    }

    private static void pni(final Object o) {
        out.println(o);
        out.flush();
    }

    private static class Reader {
        private final int BUFFER_SIZE = 1 << 19;
        private final DataInputStream din;
        private final byte[] buffer;
        private int bufferPointer, bytesRead;
        private StringTokenizer st;
        private final BufferedReader br;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public Reader(final String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            br = new BufferedReader(new FileReader(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String next() throws Exception {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (final IOException e) {
                    throw new Exception(e.toString());
                }
            }
            return st.nextToken();
        }

        public String nextLine() throws Exception {
            String str = "";
            try {
                str = br.readLine();
            } catch (final IOException e) {
                throw new Exception(e.toString());
            }
            return str;
        }

        final byte[] buf = new byte[SCAN_LINE_LENGTH];

        public String readLine() throws IOException {
            int cnt = 0;
            int c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    if (cnt == 0)
                        continue;
                    else
                        break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public String readToken() throws IOException {
            int cnt = 0;
            int c;
            while ((c = read()) != -1) {
                if (c == '\n' || c == ' ')
                    if (cnt == 0)
                        continue;
                    else
                        break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }

    @SuppressWarnings({ "unchecked" })
    private static <T> T deepCopy(final T old) {
        try {
            return (T) deepCopyObject(old);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    private static Object deepCopyObject(final Object oldObj) throws Exception {
        ObjectOutputStream oos = null;
        ObjectInputStream ois = null;
        try {
            final ByteArrayOutputStream bos = new ByteArrayOutputStream(); // A
            oos = new ObjectOutputStream(bos); // B
            // serialize and pass the object
            oos.writeObject(oldObj); // C
            oos.flush(); // D
            final ByteArrayInputStream bin = new ByteArrayInputStream(bos.toByteArray()); // E
            ois = new ObjectInputStream(bin); // F
            // return the new object
            return ois.readObject(); // G
        } catch (final Exception e) {
            pni("Exception in ObjectCloner = " + e);
            throw (e);
        } finally {
            oos.close();
            ois.close();
        }
    }

}