Problem: Polycarp has a favorite sequence a[1 ... n] consisting of n integers. He wrote it out on the whiteboard as follows:

  * he wrote the number a_1 to the left side (at the beginning of the whiteboard); 
  * he wrote the number a_2 to the right side (at the end of the whiteboard); 
  * then as far to the left as possible (but to the right from a_1), he wrote the number a_3; 
  * then as far to the right as possible (but to the left from a_2), he wrote the number a_4; 
  * Polycarp continued to act as well, until he wrote out the entire sequence on the whiteboard. 

<image> The beginning of the result looks like this (of course, if n ≥ 4).

For example, if n=7 and a=[3, 1, 4, 1, 5, 9, 2], then Polycarp will write a sequence on the whiteboard [3, 4, 5, 2, 9, 1, 1].

You saw the sequence written on the whiteboard and now you want to restore Polycarp's favorite sequence.

Input

The first line contains a single positive integer t (1 ≤ t ≤ 300) — the number of test cases in the test. Then t test cases follow.

The first line of each test case contains an integer n (1 ≤ n ≤ 300) — the length of the sequence written on the whiteboard.

The next line contains n integers b_1, b_2,…, b_n (1 ≤ b_i ≤ 10^9) — the sequence written on the whiteboard.

Output

Output t answers to the test cases. Each answer — is a sequence a that Polycarp wrote out on the whiteboard.

Example

Input


6
7
3 4 5 2 9 1 1
4
9 2 7 1
11
8 4 3 1 2 7 8 7 9 4 2
1
42
2
11 7
8
1 1 1 1 1 1 1 1


Output


3 1 4 1 5 9 2 
9 1 2 7 
8 2 4 4 3 9 1 7 2 8 7 
42 
11 7 
1 1 1 1 1 1 1 1 

Note

In the first test case, the sequence a matches the sequence from the statement. The whiteboard states after each step look like this:

[3] ⇒ [3, 1] ⇒ [3, 4, 1] ⇒ [3, 4, 1, 1] ⇒ [3, 4, 5, 1, 1] ⇒ [3, 4, 5, 9, 1, 1] ⇒ [3, 4, 5, 2, 9, 1, 1].

Solution (in JAVA):

Solution:

import java.awt.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.*;
import java.util.List;

/**
 * Codeforces
 * 
 * 
 */
public class Codeforcess {

    public static boolean has1inbetween(String s, int i, int j) {
        boolean ans = true;
        char ch[] = s.toCharArray();

        for (int b = i + 1; b < j && b < s.length() && i < ch.length && j < ch.length; b++) {
            if (ch[i] == '1') {
                ans = false;
            }
        }
        return ans;
    }

    public static int segregate(int arr[], int size) {
        int j = 0, i;
        for (i = 0; i < size; i++) {
            if (arr[i] <= 0) {
                int temp;
                temp = arr[i];
                arr[i] = arr[j];
                arr[j] = temp;
                // increment count of non-positive
                // integers
                j++;
            }
        }

        return j;
    }

    public static long lowComMultiple(long a, long b) {
        long min = a * b;
        long start = Math.min(a, b);
        long ans = -1;
        for (int i = (int) start; i <= min; i++) {
            if (i % a == 0 && i % b == 0) {
                ans = i;
                break;
            }
        }
        return ans;
    }

    public static int solution(int[] A) {
        int n = A.length;

        // To mark the occurrence of elements
        boolean[] present = new boolean[n + 1];

        // Mark the occurrences
        for (int i = 0; i < n; i++) {

            if (A[i] > 0 && A[i] <= n)
                present[A[i]] = true;
        }

        // Find the first element which didn't
        // appear in the original array
        for (int i = 1; i <= n; i++)
            if (!present[i])
                return i;

        return n + 1;
    }

    public static ArrayList<Long> digit(long num) {
        long dig = 0;
        // long length = 0;
        ArrayList<Long> digi = new ArrayList<>();
        while (num > 0) {
            dig = num % 10;
            digi.add(dig);
            num = num / 10;

        }
        // return dig; //System.out.printf("%d", +revnum);

        return digi;
    }

    static int[] shuffle(int a[], int n) {
        for (int i = 0; i < n; i++) {

            // getting the random index
            int t = (int) Math.random() * a.length;

            // and swapping values a random index
            // with the current index
            int x = a[t];
            a[t] = a[i];
            a[i] = x;
        }
        return a;
    }

    public static long addDigits(long num) {
        long digit = 0;
        // long sum = 0;
        long dig = -1;

        while (num != 0) {
            digit = num % 10;
            dig = digit;
            num = num / 10;
            break;
        }
        return dig;
    }

    public static int addDigit(long num) {
        long digit = 0;
        // long sum = 0;
        int count = 0;

        while (num != 0) {
            digit = num % 10;
            count++;
            num = num / 10;

        }
        return count;
    }

    public static class Pair<A, B> {
        private A first;
        private B second;

        public Pair(A first, B second) {
            this.first = first;
            this.second = second;
        }

        public A getFirst() {
            return first;
        }

        public B getSecond() {
            return second;
        }

        public void setFirst(A first) {
            this.first = first;
        }

        public void setSecond(B second) {
            this.second = second;
        }
    }

    static void findPair(int values[], int n, Pair<Integer, Integer> ans) {
        // Pair<Integer, Integer> ans = new Pair<Integer,Integer>(0, 0);
        int size = values.length;
        int i = 0, j = 1;
        int minLen = Integer.MAX_VALUE;
        int in = -1;
        int jn = -1;
        while (i < size && j < size) {

            if (i != j && values[j] - values[i] == n) {

                if (j - i < minLen) {
                    in = i;
                    jn = j;
                }
                break;
                // System.out.print("Pair Found: " + "( " + values[i] + ", " + values[j] + "
                // )");
                // return "1";
            } else if (values[j] - values[i] < n)
                j++;
            else
                i++;
        }

        if (in == -1 && jn == -1) {
            ans.setFirst(-1);
            ans.setSecond(-1);
        } else {
            ans.setFirst(in + 1);
            ans.setSecond(jn + 1);
        }

        // return ans;
    }

    public static String findMinDays(int[] values, int[] profit) {

        StringBuilder str = new StringBuilder();
        ArrayList<Pair<Integer, Integer>> ans = new ArrayList<>();
        Pair<Integer, Integer> p = new Pair<Integer, Integer>(0, 0);
        for (int i = 0; i < profit.length; i++) {
            findPair(values, profit[i], p);
            ans.add(p);
        }

        for (int i = 0; i < ans.size(); i++) {
            if (ans.get(i).getFirst() != -1 || ans.get(i).getSecond() != -1) {
                str.append(ans.get(i).getFirst());
                str.append(" ");
                str.append(ans.get(i).getSecond() + ",");
            } else {
                str.append(-1 + ",");
            }
        }

        String s;
        str.setCharAt(str.length() - 1, ' ');
        s = str.toString();
        return s;

    }

    public static long fact(long n) {
        BigInteger res = new BigInteger("1");
        for (long i = 2; i <= n; i++)
            res = res.multiply(BigInteger.valueOf(i));
        return res.longValue();
    }

    public static long nCr(long n, long r) {
        long den = (fact(r) * fact(n - r));
        long num = fact(n);
        if (den <= 0 || num < 0)
            return 1;
        else
            return num / den;

    }

    public static int[] seq(int n, int x, int y) {
        int best = Integer.MAX_VALUE;
        int[] bestArr = new int[n];
        for (int start = 1; start <= 50; start++) {
            for (int diff = 1; diff <= 50; diff++) {
                boolean X = false, Y = false;
                int[] a = ap(n, start, diff);
                for (int i = 0; i < n; i++) {
                    if (a[i] == x)
                        X = true;
                    if (a[i] == y)
                        Y = true;

                }
                if (X && Y && a[n - 1] < best) {
                    best = a[n - 1];
                    bestArr = a;
                }
            }
        }
        return bestArr;
    }

    public static int[] ap(int n, int start, int diff) {
        int arr[] = new int[n];
        arr[0] = start;
        for (int i = 1; i < n; i++) {
            arr[i] = arr[i - 1] + diff;
        }
        return arr;
    }

    public static int cntSame(String s) {
        int ans = 0;
        for (int i = 1; i < s.length(); i++) {
            if (s.charAt(i - 1) == s.charAt(i)) {
                ans++;

            }
        }
        if (ans % 2 == 0)
            ans = ans / 2;

        return ans;
    }

    public void dump() {

        // int n = sc.nextInt();
        // int m = sc.nextInt();
        // int countNRow = 0;
        // int totalNeg = 0;
        // ArrayList<Integer> rowSignAcc = new ArrayList<>();
        // int arr[][] = new int[n][m];
        // for (int i = 0; i < n; i++) {
        // countNRow = 0;
        // for (int j = 0; j < m; j++) {
        // arr[i][j] = sc.nextInt();
        // if (arr[i][j] < 0) {
        // totalNeg++;
        // countNRow++;
        // }

        // }
        // rowSignAcc.add(countNRow);
        // }
        // int sum = 0, sum1 = 0;
        // for (int i = 0; i < n; i++) {
        // for (int j = 0; j < m; j++) {
        // if (arr[i][j] < 0) {
        // arr[i][j] = -1 * arr[i][j];
        // sum += arr[i][j];
        // } else {
        // sum += arr[i][j];
        // }
        // }
        // }
        // if (totalNeg % 2 == 0) {
        // System.out.println(sum);
        // } else {
        // arr[0][0] = -1 * arr[0][0];
        // for (int i = 0; i < n; i++) {
        // for (int j = 0; j < m; j++) {
        // sum1 += arr[i][j];
        // }
        // }
        // System.out.println(sum1);
        // }

        // }

    }

    public static boolean isPrime(long number) {
        if (number == 1)
            return false;
        else {
            for (long i = number - 1; i > 1; i--) {
                if (number % i == 0) {
                    return false;
                }
            }
            return true;
        }
    }

    public static boolean isRotations(String s1, String s2) {
        String temp = s1 + s1;
        // for (int i = 0; i < temp.length(); i++) {
        // for (int j = i + 1; j <= temp.length(); j++) {
        // String ans = temp.substring(i, j);
        // if (ans.equals(s2))
        // return true;

        // }
        // }
        return (s1.length() == s2.length()) && ((s1 + s1).indexOf(s2) != -1);
    }

    public static long Digits(BigInteger num) {
        BigInteger digit;

        long sum = 0;

        // StringBuilder rev = new StringBuilder();
        while (num.compareTo(BigInteger.valueOf(0)) != 0) {
            digit = num.remainder(BigInteger.valueOf(10));
            sum++;

            num = num.divide(BigInteger.valueOf(10));
        }

        return sum;
    }

    public static boolean isValid(String s) {
        Stack<Character> stack = new Stack<Character>();
        for (char c : s.toCharArray()) {
            if (c == '(')
                stack.push(')');
            else if (c == '{')
                stack.push('}');
            else if (c == '[')
                stack.push(']');
            else if (stack.isEmpty() || stack.pop() != c)
                return false;
        }
        return stack.isEmpty();
    }

    public static void main(String[] args) {

        try {
            Scanner sc = new Scanner(System.in);
            int t = sc.nextInt();

            while (t-- > 0) {
                int n = sc.nextInt();
                int b[] = new int[n];
                for (int i = 0; i < n; i++) {
                    b[i] = sc.nextInt();
                }
                int i = 0;
                int j = n - 1;
                StringBuilder sb = new StringBuilder();
                if (n % 2 == 0) {
                    while (i <= j) {
                        sb.append(b[i] + " ");
                        sb.append(b[j] + " ");
                        i++;
                        j--;

                    }
                } else {
                    while (i < j) {
                        sb.append(b[i] + " ");
                        sb.append(b[j] + " ");
                        i++;
                        j--;

                    }
                    sb.append(b[i] + " ");
                }
                System.out.println(sb.toString().trim());
            }

        } catch (Exception e) {
            System.out.println(e);
        }

    }
}