#include<string.h>
#include<stdio.h>
int main()
{
	char p[1001],a[1001];
	scanf("%s",p);
	long long int l,i,j,k,m,cnt=0;
	scanf("%lld",&k);
	l=strlen(p);
	char c[(l/k)+1];
	for(i=0;i<l;i+=(l/k))
	{
		m=0;
		for(j=i;j<(i+(l/k));j++)
		{
			c[m]=p[j];
			m+=1;
		}
		c[l/k]='\0';
		strrev(c);
		if(i==0)
		strcpy(a,c);
		else
		strcat(a,c);
		//printf("%s\n",a);
	}
	if(strcmp(p,a)==0)
		printf("YES");
	else
		printf("NO");
	return 0;
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func min_int(a int, b int) int { if a < b { return a } else { return b } }
func min_int64(a int64, b int64) int64 { if a < b { return a } else { return b } }

func max_int(a int, b int) int { if a > b { return a } else { return b } }
func max_int64(a int64, b int64) int64 { if a > b { return a } else { return b } }

func main() {
	defer writer.Flush()

	var T int = 0
	scanf("%d\n", &T)

	for t := 0; t < T; t++ {

		var N int
		scanf("%d\n", &N)

		res := make([]int, N)
		for i := 0; i < N; i++ {
			res[i] = 2*(2*N-i)
		}

		for i := 0; i < N; i++ {
			if i != N-1 {
				printf("%d ", res[i])
			} else {
				printf("%d\n", res[i])
			}
		}

	}

}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func solve() {
	t := readInt()
	for i := 0; i < t; i++ {
		solveSingle()
	}
}

func solveSingle() {
	n := readInt()
	up := (n * 4) - 2
	for i := 0; i < n; i++ {
		if i > 0 {
			fmt.Print(" ")
		}
		fmt.Print(up)
		up -= 2
	}
	fmt.Println()
}

var scanner *bufio.Scanner

func main() {
	scanner = bufio.NewScanner(os.Stdin)
	const MaxTokenLength = 1024 * 1024
	scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func min(a int64, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readInt64() int64 {
	v, _ := strconv.ParseInt(readString(), 10, 64)
	return v
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readInt64Array(n int) []int64 {
	res := make([]int64, n)
	for i := 0; i < n; i++ {
		res[i] = readInt64()
	}
	return res
}


package main
import "fmt"
func main() {
	q := 0
	fmt.Scan(&q)
	for t := 0; t < q; t++ {
		n := 0
		fmt.Scan(&n)
		for i := 2 * n + 2; i <= 4 * n; i += 2 {
			fmt.Print(i, " ")
		}
		fmt.Println()
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	//rd, _ := os.Open("input")
	//in := bufio.NewReader(rd)
	in := bufio.NewReader(os.Stdin)

	var t, n int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
		fmt.Fscan(in, &n)
		result := ""
		for i := 0; i < n; i++ {
			result += strconv.Itoa(4*n-2*i) + " "
		}
		fmt.Println(result)
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(reader, &t)

	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(reader, &n)

		for j, k := 0, 4*n; j < n; j, k = j+1, k-2 {
			fmt.Printf("%d ", k)
		}

		fmt.Println()
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader = bufio.NewReader(os.Stdin)

func main() {
	var t int
	fmt.Fscan(reader, &t)

	for i := 0; i < t; i++ {
		var n int
		fmt.Fscan(reader, &n)

		sieve := make([]bool, 4*n+1)
		var chairs []int
		for j := 4; j <= 4*n; j += 2 {
			if len(chairs) == n {
				break
			}

			if j%2 == 1 {
				continue
			}

			if sieve[j] == true {
				continue
			}

			chairs = append(chairs, j)

			for k := j + j; k <= 4*n; k += j {
				sieve[k] = true
			}
		}

		for _, c := range chairs {
			fmt.Printf("%d ", c)
		}
		fmt.Println()
	}
}


package main

import "fmt"

func main() {
	var t int
	fmt.Scanf("%d\n", &t)

	for count := 0; count < t; count++ {
		var q int
		fmt.Scanf("%d\n", &q)

		base := 4

		for i := 0; i < q; i++ {
			fmt.Printf("%d ", base)
			base += 2
			if i >= 1 {
				base += 2
			}

		}
		fmt.Println("")

	}
}


package main

import "fmt"

func main() {
	var t int
	fmt.Scanf("%d\n", &t)

	for count := 0; count < t; count++ {
		var q int
		fmt.Scanf("%d\n", &q)

		base := 2 * q

		for i := 0; i < q; i++ {
			fmt.Printf("%d ", base)
			base += 2
			// if i >= 1 {
			// 	base += 2
			// }

		}
		fmt.Println("")

	}
}


package main

import (
	"bufio"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func print(str string) {
	writer.WriteString(str)
}

func nextInt() int {
	scanner.Scan()
	str := scanner.Text()
	val, _ := strconv.Atoi(str)
	return val
}

func nextFloat() float64 {
	scanner.Scan()
	str := scanner.Text()
	val, _ := strconv.ParseFloat(str, 64)
	return val
}

func nextString() string {
	scanner.Scan()
	str := scanner.Text()
	return str
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanWords)
	defer writer.Flush()

	t := nextInt()
	for t != 0 {
		n := nextInt()
		for x := n + 1; x <= 2*n; x++ {
			print(strconv.Itoa(2*x) + " ")
		}
		print("\n")
		t--
	}
}


package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4*a
		for j:=1;j<=a;j++{
			s-=2
			if j!=a {
				fmt.Printf("%d ",s)
			}else{
				fmt.Printf("%d\n",s)
			}
		}
	}
}


package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4
		for j:=1;j<=a;j++{
			fmt.Printf("%d ",s)
			if j==1 {
				s+=2
			}else {
				s+=4
			}
		}
		fmt.Printf("\n")
	}
}


package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scan(&t)
	for i:=1;i<=t;i++{
		fmt.Scan(&a)
		s=4*a
		for j:=1;j<=a;j++{
			s-=2
			fmt.Printf("%d ",s)
		}
		fmt.Printf("\n")
	}
}


package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4
		for j:=1;j<=a;j++{
			fmt.Printf("%d ",s)
			if j==1 {
				s+=2
			}else {
				s+=4
			}
		}
		fmt.Println()
	}
}


package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4*a
		for j:=1;j<=a;j++{
			s-=2
			fmt.Printf("%d ",s)
		}
		fmt.Printf("\n")
	}
}


package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scanf("%d",&a)
		s=4
		c=2
		for j:=1;j<=a;j++{
			fmt.Printf("%d ",s)
			s+=c
			c+=2
		}
		fmt.Println()
	}
}


package main

import (
	"fmt"
)

var t,a,s,c int

func main()  {
	fmt.Scanf("%d",&t)
	for i:=1;i<=t;i++{
		fmt.Scan(&a)
		s=4*a
		for j:=1;j<=a;j++{
			s-=2
			fmt.Printf("%d ",s)
		}
		fmt.Printf("\n")
	}
}


from collections import Counter, defaultdict, deque
import bisect
import heapq
from sys import stdin, stdout
from itertools import repeat
import math
import random
import copy

# sys.stdin = open('input')

def mod(x, y, mod):
    re = 1
    now = x
    while y:
        if y&1:
            re *= now
            re %= mod
        y >>= 1
        now = (now*now)%mod
    return re

def inp(force_list=False):
    re = map(int, raw_input().split())
    if len(re) == 1 and not force_list:
        return re[0]
    return re

def inst():
    return raw_input().strip()

def gcd(x, y):
   while(y):
       x, y = y, x % y
   return x

def ggcd(x, y):
    if y:
        return ggcd(y, x%y)
    return x

MOD = int(1e9+7)

def my_main():
    T = inp()
    for _ in range(T):
        n = inp()
        c = 4*n
        for i in range(n):
            print c - i*2,
        print ''

my_main()


from __future__ import division, print_function

''' Hey stalker :) '''
INF = 10 ** 50
TEST_CASES = True

from collections import defaultdict, deque, Counter
from functools import reduce
from bisect import bisect_left

def main():
    n = get_int()
    x = 2*n
    res = []
    for i in range(n):
        res.append(x)
        x += 2
    print(" ".join(map(str, res)))

''' FastIO Footer: PyRival Library, Thanks @c1729 and contributors '''
import os
import sys
from bisect import bisect_left, bisect_right, bisect
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
# else:
#     sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))

if __name__ == "__main__":
    if TEST_CASES:
        [main() for _ in range(int(input()))]
    else:
        main()


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def main():
    t = int(input())

    for _ in range(t):
        n = int(input())
        print(*range(2 * (n + 1), 4 * n + 1, 2))

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


out = []
for _ in range(int(input())):
    n = int(input())
    out.append(' '.join(map(str, [i for i in range((n << 1) + 2, n * 4 + 1, 2)])))

print('\n'.join(out))


from __future__ import division, print_function

MOD = 998244353
mod = 10**9 + 7

# import resource
# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])

def prepare_factorial():
    fact = [1]
    for i in range(1, 20):
        fact.append((fact[-1] * i) % mod)
    ifact = [0] * 105
    ifact[104] = pow(fact[104], mod - 2, mod)
    for i in range(104, 0, -1):
        ifact[i - 1] = (i * ifact[i]) % mod

    return fact, ifact

# import threading
# threading.stack_size(1<<27)
import sys
# sys.setrecursionlimit(10000)

from bisect import bisect_left, bisect_right, insort
from math import floor, ceil, sqrt, degrees, atan, pi, log, sin, radians, factorial
from heapq import heappop, heapify, heappush
from collections import Counter, defaultdict, deque
# from itertools import permutations

def modinv(n, p):
    return pow(n, p - 2, p)

def ncr(n, r, fact, ifact):    # for using this uncomment the lines calculating fact and ifact
    t = (fact[n] * (ifact[r] * ifact[n-r]) % mod) % mod
    return t

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def input(): return sys.stdin.readline().strip()

"""*****************************************************************************************"""

def GCD(x, y):
    while y:
        x, y = y, x % y
    return x

def lcm(x, y):
    return (x * y)//(GCD(x, y))

def get_xor(n):
    return [n, 1, n+1, 0][n % 4]

def get_n(P):    # this function returns the maximum n for which Summation(n) <= Sum
    ans = (-1 + sqrt(1 + 8*P))//2
    return ans

""" ********************************************************************************************* """

def main():
    def prime_sieve(n):
        """returns a sieve of primes >= 5 and < n"""
        flag = n % 6 == 2
        sieve = bytearray((n // 3 + flag >> 3) + 1)
        for i in range(1, int(n ** 0.5) // 3 + 1):
            if not (sieve[i >> 3] >> (i & 7)) & 1:
                k = (3 * i + 1) | 1
                for j in range(k * k // 3, n // 3 + flag, 2 * k):
                    sieve[j >> 3] |= 1 << (j & 7)
                for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
                    sieve[j >> 3] |= 1 << (j & 7)
        return sieve

    def prime_list(n):
        """returns a list of primes <= n"""
        res = []
        if n > 1:
            res.append(2)
        if n > 2:
            res.append(3)
        if n > 4:
            sieve = prime_sieve(n + 1)
            res.extend(
                3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not (sieve[i >> 3] >> (i & 7)) & 1)
        return res

    p = prime_list(1000)

    # print(p)
    T = int(input())
    while T:
        n = int(input())
        ans = []
        for i in range(n):
            ans.append(p[i] * 2)

        print(*ans)
        T -= 1

""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):

    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

if __name__ == '__main__':
    main()
    # threading.Thread(target=main).start()


from __future__ import division, print_function

MOD = 998244353
mod = 10**9 + 7

# import resource
# resource.setrlimit(resource.RLIMIT_STACK, [0x100000000, resource.RLIM_INFINITY])

def prepare_factorial():
    fact = [1]
    for i in range(1, 20):
        fact.append((fact[-1] * i) % mod)
    ifact = [0] * 105
    ifact[104] = pow(fact[104], mod - 2, mod)
    for i in range(104, 0, -1):
        ifact[i - 1] = (i * ifact[i]) % mod

    return fact, ifact

# import threading
# threading.stack_size(1<<27)
import sys
# sys.setrecursionlimit(10000)

from bisect import bisect_left, bisect_right, insort
from math import floor, ceil, sqrt, degrees, atan, pi, log, sin, radians, factorial
from heapq import heappop, heapify, heappush
from collections import Counter, defaultdict, deque
# from itertools import permutations

def modinv(n, p):
    return pow(n, p - 2, p)

def ncr(n, r, fact, ifact):    # for using this uncomment the lines calculating fact and ifact
    t = (fact[n] * (ifact[r] * ifact[n-r]) % mod) % mod
    return t

def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def input(): return sys.stdin.readline().strip()

"""*****************************************************************************************"""

def GCD(x, y):
    while y:
        x, y = y, x % y
    return x

def lcm(x, y):
    return (x * y)//(GCD(x, y))

def get_xor(n):
    return [n, 1, n+1, 0][n % 4]

def get_n(P):    # this function returns the maximum n for which Summation(n) <= Sum
    ans = (-1 + sqrt(1 + 8*P))//2
    return ans

""" ********************************************************************************************* """

def main():
    def prime_sieve(n):
        """returns a sieve of primes >= 5 and < n"""
        flag = n % 6 == 2
        sieve = bytearray((n // 3 + flag >> 3) + 1)
        for i in range(1, int(n ** 0.5) // 3 + 1):
            if not (sieve[i >> 3] >> (i & 7)) & 1:
                k = (3 * i + 1) | 1
                for j in range(k * k // 3, n // 3 + flag, 2 * k):
                    sieve[j >> 3] |= 1 << (j & 7)
                for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
                    sieve[j >> 3] |= 1 << (j & 7)
        return sieve

    def prime_list(n):
        """returns a list of primes <= n"""
        res = []
        if n > 1:
            res.append(2)
        if n > 2:
            res.append(3)
        if n > 4:
            sieve = prime_sieve(n + 1)
            res.extend(
                3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not (sieve[i >> 3] >> (i & 7)) & 1)
        return res

    # p = prime_list(1000)

    T = int(input())
    while T:
        n = int(input())
        ans = []
        curr = 4 * n
        count = 0

        while count < n:
            ans.append(curr)
            curr -= 2
            count += 1

        print(*ans)
        T -= 1

""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):

    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

if __name__ == '__main__':
    main()
    # threading.Thread(target=main).start()


for _ in range(input()):
    n=input()
    for i in range(4*n-2,2*n-1,-2):
        print i,
    print


from __future__ import division,print_function
from heapq import*
import sys

le = sys.__stdin__.read().split("\n")[::-1]
af = []
for k in range(int(le.pop())):
    n=int(le.pop())
    af.append(" ".join(map(str, range(2*n+2,4*n+2,2))))
print("\n".join(map(str,af)))


from __future__ import division, print_function
import threading,bisect,math,heapq,sys
# threading.stack_size(2**27)
# sys.setrecursionlimit(10**4)
from sys import stdin, stdout
i_m=9223372036854775807
def cin():
    return map(int,sin().split())
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
prime=[]
def dfs(n,d,v,a,c):
    v[n]=1
    if n in d:
        x=d[n]
    else:
        a[n]+=c
        x=[]
    p=a[n]
    for i in x:
        if i not in v:
            dfs(i,d,v,a,c)
            p+=a[i]
    a[n]=p
    return p
"""**************************MAIN*****************************"""
def main():
    t=inin()
    print(t)
    for _ in range(t):
        n=inin()
        a=[4]
        for i in range(1,1*n):
            a.append(4*i+2)
        print(*a)
        # print(n)

"""*******************************************************"""

######## Python 2 and 3 footer by Pajenegod and c1729
fac=[]
def fact(n,mod):
    global fac
    fac.append(1)
    for i in range(1,n+1):
        fac.append((fac[i-1]*i)%mod)
    f=fac[:]
    return f
def nCr(n,r,mod):
    global fac
    x=fac[n]
    y=fac[n-r]
    z=fac[r]
    x=moddiv(x,y,mod)
    return moddiv(x,z,mod)
def moddiv(m,n,p):
    x=pow(n,p-2,p)
    return (m*x)%p
def GCD(x, y):
    x=abs(x)
    y=abs(y)
    if(min(x,y)==0):
        return max(x,y)
    while(y):
        x, y = y, x % y
    return x
def Divisors(n) :
    l = []
    ll=[]
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) :
            if (n // i == i) :
                l.append(i)
            else :
                l.append(i)
                ll.append(n//i)
    l.extend(ll[::-1])
    return l
def SieveOfEratosthenes(n):
    global prime
    prime = [True for i in range(n+1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    f=[]
    for p in range(2, n):
        if prime[p]:
            f.append(p)
    return f
def primeFactors(n):
    a=[]
    while n % 2 == 0:
        a.append(2)
        n = n // 2
    for i in range(3,int(math.sqrt(n))+1,2):
        while n % i== 0:
            a.append(i)
            n = n // i
    if n > 2:
        a.append(n)
    return a
"""*******************************************************"""
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange
import os
from io import IOBase, BytesIO
BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
# Cout implemented in Python
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

# Read all remaining integers in stdin, type is given by optional argument, this is fast
def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'R' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'R' [0]:
        A.append(sign*numb)
    return A

# threading.Thread(target=main).start()
if __name__== "__main__":
  main()


from __future__ import division, print_function
import threading,bisect,math,heapq,sys
# threading.stack_size(2**27)
# sys.setrecursionlimit(10**4)
from sys import stdin, stdout
i_m=9223372036854775807
def cin():
    return map(int,sin().split())
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
prime=[]
def dfs(n,d,v,a,c):
    v[n]=1
    if n in d:
        x=d[n]
    else:
        a[n]+=c
        x=[]
    p=a[n]
    for i in x:
        if i not in v:
            dfs(i,d,v,a,c)
            p+=a[i]
    a[n]=p
    return p
"""**************************MAIN*****************************"""
def main():
    t=inin()
    # print(t)
    for _ in range(t):
        n=inin()
        a=[4]
        for i in range(1,1*n):
            a.append(4*i+2)
        print(*a)
        # print(n)

"""*******************************************************"""

######## Python 2 and 3 footer by Pajenegod and c1729
fac=[]
def fact(n,mod):
    global fac
    fac.append(1)
    for i in range(1,n+1):
        fac.append((fac[i-1]*i)%mod)
    f=fac[:]
    return f
def nCr(n,r,mod):
    global fac
    x=fac[n]
    y=fac[n-r]
    z=fac[r]
    x=moddiv(x,y,mod)
    return moddiv(x,z,mod)
def moddiv(m,n,p):
    x=pow(n,p-2,p)
    return (m*x)%p
def GCD(x, y):
    x=abs(x)
    y=abs(y)
    if(min(x,y)==0):
        return max(x,y)
    while(y):
        x, y = y, x % y
    return x
def Divisors(n) :
    l = []
    ll=[]
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) :
            if (n // i == i) :
                l.append(i)
            else :
                l.append(i)
                ll.append(n//i)
    l.extend(ll[::-1])
    return l
def SieveOfEratosthenes(n):
    global prime
    prime = [True for i in range(n+1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    f=[]
    for p in range(2, n):
        if prime[p]:
            f.append(p)
    return f
def primeFactors(n):
    a=[]
    while n % 2 == 0:
        a.append(2)
        n = n // 2
    for i in range(3,int(math.sqrt(n))+1,2):
        while n % i== 0:
            a.append(i)
            n = n // i
    if n > 2:
        a.append(n)
    return a
"""*******************************************************"""
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange
import os
from io import IOBase, BytesIO
BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
# Cout implemented in Python
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

# Read all remaining integers in stdin, type is given by optional argument, this is fast
def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'R' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'R' [0]:
        A.append(sign*numb)
    return A

# threading.Thread(target=main).start()
if __name__== "__main__":
  main()


from __future__ import division, print_function
import threading,bisect,math,heapq,sys
# threading.stack_size(2**27)
# sys.setrecursionlimit(10**4)
from sys import stdin, stdout
i_m=9223372036854775807
def cin():
    return map(int,sin().split())
def ain():                           #takes array as input
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
prime=[]
def dfs(n,d,v,a,c):
    v[n]=1
    if n in d:
        x=d[n]
    else:
        a[n]+=c
        x=[]
    p=a[n]
    for i in x:
        if i not in v:
            dfs(i,d,v,a,c)
            p+=a[i]
    a[n]=p
    return p
"""**************************MAIN*****************************"""
def main():
    t=inin()
    for _ in range(t):
        n=inin()
        a=[]
        x=4*n
        for i in range(n):
            a.append(x)
            x-=2
        print(*a)
        # print(n)

"""*******************************************************"""

######## Python 2 and 3 footer by Pajenegod and c1729
fac=[]
def fact(n,mod):
    global fac
    fac.append(1)
    for i in range(1,n+1):
        fac.append((fac[i-1]*i)%mod)
    f=fac[:]
    return f
def nCr(n,r,mod):
    global fac
    x=fac[n]
    y=fac[n-r]
    z=fac[r]
    x=moddiv(x,y,mod)
    return moddiv(x,z,mod)
def moddiv(m,n,p):
    x=pow(n,p-2,p)
    return (m*x)%p
def GCD(x, y):
    x=abs(x)
    y=abs(y)
    if(min(x,y)==0):
        return max(x,y)
    while(y):
        x, y = y, x % y
    return x
def Divisors(n) :
    l = []
    ll=[]
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) :
            if (n // i == i) :
                l.append(i)
            else :
                l.append(i)
                ll.append(n//i)
    l.extend(ll[::-1])
    return l
def SieveOfEratosthenes(n):
    global prime
    prime = [True for i in range(n+1)]
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    f=[]
    for p in range(2, n):
        if prime[p]:
            f.append(p)
    return f
def primeFactors(n):
    a=[]
    while n % 2 == 0:
        a.append(2)
        n = n // 2
    for i in range(3,int(math.sqrt(n))+1,2):
        while n % i== 0:
            a.append(i)
            n = n // i
    if n > 2:
        a.append(n)
    return a
"""*******************************************************"""
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange
import os
from io import IOBase, BytesIO
BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
# Cout implemented in Python
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

# Read all remaining integers in stdin, type is given by optional argument, this is fast
def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'R' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'R' [0]:
        A.append(sign*numb)
    return A

# threading.Thread(target=main).start()
if __name__== "__main__":
  main()


import sys
if sys.subversion[0] == "PyPy":
    import io, atexit
    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()

RS = raw_input
RI = lambda x=int: map(x,RS().split())
RN = lambda x=int: x(RS())
''' ...................................................................... '''

for _ in xrange(RN()):
    n = RN()
    arr = [4*n-2*i for i in xrange(n)]
    print ' '.join(map(str,arr))


import sys
if sys.subversion[0] == "PyPy":
    import io, atexit
    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()

RS = raw_input
RI = lambda x=int: map(x,RS().split())
RN = lambda x=int: x(RS())
''' ...................................................................... '''

for _ in xrange(RN()):
    n = RN()
    arr = [4*n-i for i in xrange(n)]
    print ' '.join(map(str,arr))


# Author : raj1307 - Raj Singh
# Date   : 02.11.2020

from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin  = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')

def main():

    #for _ in range(ii()):

    l=[]
    for i in range(2,401):
        if isPrime(i):
            l.append(i)

    #print(len(l))

    x=[]
    p=0
    for i in range(len(l)):

        if len(x)>=100:
            break

        for j in range(i,len(l)):

            if l[i]*l[j]<=400:
                x.append(l[i]*l[j])

    #print(len(x))

    x.sort()

    for _ in range(ii()):

        n=ii()

        print(*x[:n])

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    main()
    #dmain()

# Comment Read()


# Author : raj1307 - Raj Singh
# Date   : 02.11.2020

from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin  = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')

def main():

    #for _ in range(ii()):

    # l=[]
    # f=[0]*405
    # for i in range(2,401,2):
    #     if f[i]==1:
    #         continue
    #     if isPrime(i):
    #         f[i]=1
    #     else:
    #         for j in range(i+i,401,i):
    #             f[j]=1
    #         l.append(i)

    # print(len(l))

    # x=[]
    # p=0
    # for i in range(len(l)):

    #     if len(x)>=100:
    #         break

    #     for j in range(i+1,len(l)):

    #         if l[i]*l[j]<=400:
    #             x.append(l[i]*l[j])
    #return

    # for i in range(len(l)):

    #     if l[i]*2>400:
    #         break

    #     x.append(2*l[i])

    # print(len(x))

    #x.sort()

    for _ in range(ii()):

        n=ii()

        cnt=0
        for i in range(4*n,0,-2):
            cnt+=1
            print(i,end=' ')
            if cnt==n:
                break
        print()

        #print(*l[:n])

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    main()
    #dmain()

# Comment Read()


# Author : raj1307 - Raj Singh
# Date   : 02.11.2020

from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin  = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')

def main():

    #for _ in range(ii()):

    l=[]
    f=[0]*405
    for i in range(2,401,2):
        if f[i]==1:
            continue
        if isPrime(i):
            f[i]=1
        else:
            for j in range(i+i,401,i):
                f[i]=1
            l.append(i)

    #print(len(l))

    x=[]
    # p=0
    # for i in range(len(l)):

    #     if len(x)>=100:
    #         break

    #     for j in range(i+1,len(l)):

    #         if l[i]*l[j]<=400:
    #             x.append(l[i]*l[j])
    #return

    # for i in range(len(l)):

    #     if l[i]*2>400:
    #         break

    #     x.append(2*l[i])

    # print(len(x))

    x.sort()

    for _ in range(ii()):

        n=ii()

        print(*l[:n])

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    main()
    #dmain()

# Comment Read()


# Author : raj1307 - Raj Singh
# Date   : 02.11.2020

from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().strip().split(" "))
def msi(): return map(str,input().strip().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[1]
def sort2(l):return sorted(l, key=getKey,reverse=True)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))

def ceil(x,y):
    if x%y==0:
        return x//y
    else:
        return x//y+1

def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def isPrime(n) : # Check Prime Number or not
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

def read():
    sys.stdin  = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')

def main():

    #for _ in range(ii()):

    l=[]
    f=[0]*405
    for i in range(2,401):
        if f[i]==1:
            continue
        if isPrime(i):
            f[i]=1
        else:
            for j in range(i+i,401,i):
                f[i]=1
            l.append(i)

    #print(len(l))

    x=[]
    # p=0
    # for i in range(len(l)):

    #     if len(x)>=100:
    #         break

    #     for j in range(i+1,len(l)):

    #         if l[i]*l[j]<=400:
    #             x.append(l[i]*l[j])
    #return

    # for i in range(len(l)):

    #     if l[i]*2>400:
    #         break

    #     x.append(2*l[i])

    # print(len(x))

    x.sort()

    for _ in range(ii()):

        n=ii()

        print(*l[:n])

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()

if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    main()
    #dmain()

# Comment Read()


import sys

input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    s = input()
    return (list(s[:len(s) - 1]))

def invr():
    return (map(int, input().split()))

def endline():
    return (input())

def isPrime(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
        return True
    else:
        return False

def main():
    t = inp()
    while t > 0:
        t -= 1
        n = inp()

        if n == 1:
            print(n),

        i = 2
        while n > 0:
            if isPrime(i):
                print(2 * i),
                n -= 1
            i += 1

        print("")

input = sys.stdin.readline;
main()


import sys

input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    s = input()
    return (list(s[:len(s) - 1]))

def invr():
    return (map(int, input().split()))

def endline():
    return (input())

def isPrime(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
        return True
    else:
        return False

def main():
    t = inp()
    while t > 0:
        t -= 1
        n = inp()

        while n > 0:
            if n == 1:
                print(4),
            else:
                print((4 * n) - 2),
            n -= 1

        print("")

input = sys.stdin.readline;
main()


import sys

input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    s = input()
    return (list(s[:len(s) - 1]))

def invr():
    return (map(int, input().split()))

def endline():
    return (input())

def isPrime(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
        return True
    else:
        return False

def main():
    t = inp()
    while t > 0:
        t -= 1
        n = inp()

        if n == 1:
            print(4)
        else:
            i = 2
            while n > 0:
                if isPrime(i):
                    print(2 * i),
                    n -= 1
                i += 1

            print("")

input = sys.stdin.readline;
main()


import sys

input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    s = input()
    return (list(s[:len(s) - 1]))

def invr():
    return (map(int, input().split()))

def endline():
    return (input())

def isPrime(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
        return True
    else:
        return False

def main():
    t = inp()
    while t > 0:
        t -= 1
        n = inp()

        for i in range(n):
            ans = 4 * n - (i * 2)
            print(ans),

        print("")

input = sys.stdin.readline;
main()


import sys

input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    s = input()
    return (list(s[:len(s) - 1]))

def invr():
    return (map(int, input().split()))

def endline():
    return (input())

def isPrime(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
        return True
    else:
        return False

def main():
    t = inp()
    while t > 0:
        t -= 1
        n = inp()

        if n == 1:
            print(n)

        i = 2
        while n > 0:
            if isPrime(i):
                print(2 * i),
                n -= 1
            i += 1

        print("")

input = sys.stdin.readline;
main()


import sys

input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    s = input()
    return (list(s[:len(s) - 1]))

def invr():
    return (map(int, input().split()))

def endline():
    return (input())

def isPrime(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
        return True
    else:
        return False

def main():
    t = inp()
    while t > 0:
        t -= 1
        n = inp()

        if n == 1:
            print(n)
        else:
            i = 2
            while n > 0:
                if isPrime(i):
                    print(2 * i),
                    n -= 1
                i += 1

            print("")

input = sys.stdin.readline;
main()


import sys

input = sys.stdin.readline

############ ---- Input Functions ---- ############
def inp():
    return (int(input()))

def inlt():
    return (list(map(int, input().split())))

def insr():
    s = input()
    return (list(s[:len(s) - 1]))

def invr():
    return (map(int, input().split()))

def endline():
    return (input())

def isPrime(num):
    if num > 1:
        for i in range(2, num):
            if (num % i) == 0:
                return False
        return True
    else:
        return False

def main():
    t = inp()
    while t > 0:
        t -= 1
        n = inp()

        while n > 0:
            if n == 1:
                print(4),
            else:
                print((4 * n - 2)),
            n -= 1

        print("")

input = sys.stdin.readline;
main()


for _ in range(int(input())):
    n=int(input())

    def solve(n):
        arr=[]
        for i in range(4,4*n+1):
            if i%2==0:
                arr.append(i)

        count=0
        for i in range(len(arr)-1,-1,-1):
            print arr[i],
            count+=1
            if count==n:
                print ""
                break
    solve(n)


from __future__ import print_function # for PyPy2
from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math

g   = lambda : stdin.readline().strip()
gl  = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1e9)+7
inf = float("inf")

t, = gil()
for _ in range(t):
	n, = gil()
	print(*list(range(4, 2*n+1, 2)))


from __future__ import print_function # for PyPy2
from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math

g   = lambda : stdin.readline().strip()
gl  = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1e9)+7
inf = float("inf")

t, = gil()
for _ in range(t):
	n, = gil()
	n *= 4
	for _ in range(n//4):
		print(n, end=" ")
		n -= 2
	print()


from __future__ import print_function # for PyPy2
from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math

g   = lambda : stdin.readline().strip()
gl  = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1e9)+7
inf = float("inf")

t, = gil()
for _ in range(t):
	n, = gil()
	print(*list(range(1, n+1)))


from __future__ import print_function # for PyPy2
from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math

g   = lambda : stdin.readline().strip()
gl  = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1e9)+7
inf = float("inf")

maxn = 401

isPrime = [1]*maxn

for x in xrange(2, int(math.ceil(math.sqrt(maxn)))+1):
	if isPrime[x]:
		for i in xrange(2, maxn):
			if i*x < maxn:
				isPrime[i*x] = 0
			else:
				break
primes = []
for i in xrange(2, maxn):
	if isPrime[i]:
		primes.append(i)

# print(primes)

t, = gil()
for _ in range(t):
	n, = gil()
	if n == 1: print(1);continue
	print(*primes[:n])


from __future__ import print_function # for PyPy2
from collections import Counter, OrderedDict
from itertools import permutations as perm
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math

g   = lambda : stdin.readline().strip()
gl  = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1e9)+7
inf = float("inf")

t, = gil()
for _ in range(t):
	n, = gil()
	print(*list(range(2, 2*n+1, 2)))


for _ in range(input()):
    n=input()
    p=4*n
    ans=[]
    for i in range(n):
        ans.append(p)
        p-=2
    print ' '.join(map(str,ans))


T=input()

r=1
while r<=T:
    n = input()
    arr = [2*n]

    index = arr[-1]+2
    while n>1:
#        print arr
        flag = True
        for ele in arr:
            if index%ele==0:
                flag = False
                break
        if flag:
            arr.append(index)
            n -= 1
        index += 2
    arr = map(str,arr)
    ans = " ".join(arr)

    print ans

    r += 1


t=int(input())
while t>0:
    t-=1
    n=int(input())
    if n==1:
        print(4)
    else:
        p=(4*n)-2
        i=1
        while i<=n:
            print(p,end=" ")
            p-=2
            i+=1
        print()


def isPrime(n) :

    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6

    return True
t=int(input())
while t>0:
    t-=1
    n=int(input())
    if n==1:
        print(4)
    else:
        print(4,end=" ")
        i=1
        p=3
        while i<n:
            if p==3:
                print(6,end=" ")
                p+=1
                i+=1
            elif p%2==0 or p%3==0:
                p+=1
            elif isPrime(p):
                print(p*2,end=" ")
                p+=1
                i+=1


def isPrime(n) :

    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6

    return True
t=int(input())
while t>0:
    t-=1
    n=int(input())
    if n==1:
        print(4)
    else:
        print(4,end=" ")
        i=1
        p=3
        while i<n:
            if p==3:
                print(6,end=" ")
                p+=1
                i+=1
            elif p%2==0 or p%3==0:
                p+=1
            elif isPrime(p):
                print(p*2,end=" ")
                p+=1
                i+=1
            else:
                p+=1


t=int(input())
while t>0:
    t-=1
    n=int(input())
    if n==1:
        print(4)
    else:
        print(4,end=" ")
        p=6
        for i in range(n-1):
            print(p,end=" ")
            p+=4


for _ in range(int(input())):
    n = int(input())
    ans = [4, 6]
    if n == 1:
        print(4)
    elif n == 2:
        print(*ans)
    else:
        for i in range(2, n+1):
            ans.append(ans[-1] + ans[-2])
        print(*ans)


for _ in range(int(input())):
    n = int(input())
    for i in range(n, 2*n):
        print(i*2, end=' ')
    print()


for _ in range(int(input())):
    n = int(input())
    ans = [4, 6]
    if n == 1:
        print(4)
    elif n == 2:
        print(*ans)
    else:
        for i in range(2, n):
            ans.append(ans[-1] + ans[-2])
        print(*ans)


for _ in range(int(input())):
    n = int(input())
    ans = [4, 6]
    has = [4, 6, 14]
    value = [4, 6, 14, 22]
    value2 = [4, 6, 14, 22, 26]
    if n == 1:
        print(4)
    elif n == 2:
        print(*ans)
    elif n == 3:
        print(*has)
    elif n == 4:
        print(*value)
    elif n == 5:
        print(*value2)
    else:
        for i in range(5, n):
            if i % 2 != 0:
                value2.append(value2[-1] + 8)
            else:
                value2.append(value2[-1] + 4)

        print(*value2)


for _ in range(int(input())):
    n = int(input())
    for i in range(1, n+1):
        print(2*i, end=' ')
    print()


for _ in range(int(input())):
    n = int(input())
    for i in range(n):
        print(2, end=' ')
    print()


t=int(input())
for i in range(t):
    n=int(input())
    p=4*n
    c=[]
    for k in range(n):
        c.append(k*2+2)

    print(*c)


t=int(input())
for i in range(t):
    n=int(input())
    p=4*n
    c=[]
    k=0
    for k in range(n,0,-1):
        c.append(p-2*k)

    print(*c)


t=int(input())
for i in range(t):
    n=int(input())
    p=4*n
    c=[]
    for k in range(n):
        c.append(k*2+4)

    print(*c)


t=int(input())
for i in range(t):
    n=int(input())
    p=4*n
    c=[]
    for k in range(n,0,-1):
        c.append(k*2+4)

    print(*c)


import math as m
def solve():
	n = int(input())
	if n == 1:
		print(4)
	else:
		l = []
		a = 4*n
		while len(l) < n:
			flag = 1
			a = a-1
			for i in l:
				if (a) % i == 0 or m.gcd(a,i) == 1:
					flag = 0
					break
			if flag == 1:
				l.append(a)
		print(*l)
if __name__ == '__main__':
	for _ in range (int(input())):
		solve()


def solve():
	n = int(input())
	if n == 1:
		print(4)
	else:
		l = [4]
		a = 4
		while len(l) < n:
			flag = 1
			a = a+2
			for i in l:
				if (a) % i == 0:
					flag = 0
					break
			if flag == 1:
				l.append(a)
		print(*l)
if __name__ == '__main__':
	for _ in range (int(input())):
		solve()


import math as m
def solve():
	n = int(input())
	if n == 1:
		print(4)
	else:
		l = []
		a = 4*n
		while len(l) < n:
			flag = 1
			for i in l:
				if (a) % i == 0 or m.gcd(a,i) == 1:
					flag = 0
					break
			if flag == 1:
				l.append(a)
			a-=1
		print(*l)
if __name__ == '__main__':
	for _ in range (int(input())):
		solve()


def solve():
	n = int(input())
	if n == 1:
		print(1)
	else:
		l = [4]
		a = 4
		while len(l) < n:
			flag = 1
			a = a+2
			for i in l:
				if (a) % i == 0:
					flag = 0
					break
			if flag == 1:
				l.append(a)
		print(*l)
if __name__ == '__main__':
	for _ in range (int(input())):
		solve()


for something in range(int(input())):
    n = int(input())
    print(*[4 * n - 2 * i for i in range(n)])


[print('4', *[2 * x for x in range(3, 2 * int(input()), 2)]) for x in range(int(input()))]


for _ in range(int(input())):
    n = int(input())
    evens = [x for x in range(2 * n, 3000) if x % 2 == 0]
    cur = []
    for num in evens:
        flag = True
        for elem in cur:
            if num % elem == 0:
                flag = False
        if flag:
            cur.append(num)
    print(*cur[:n])


for _ in range(int(input())):
    n = int(input())
    if n >= 1:
        print(4, end=" ")
    if n >= 2:
        print(6, end=" ")
    n -= 2
    cur = 6
    while n > 0:
        cur += 4
        print(cur, end=" ")
        n -= 1
    print()


for _ in range(int(input())):
    n = int(input())
    if n >= 1:
        print(4, end=" ")
    if n >= 2:
        print(6, end=" ")
    n -= 2
    cur = 6
    while n:
        cur += 4
        print(cur, end=" ")
        n -= 1
    print()


for _ in range(int(input())):
    n = int(input())
    evens = [x for x in range(4, 3000) if x % 2 == 0]
    cur = []
    for num in evens:
        flag = True
        for elem in cur:
            if num % elem == 0:
                flag = False
        if flag:
            cur.append(num)
    print(*cur[:n])


for _ in range(int(input())):
    n = int(input())
    i = 4
    print(i, end=" ")
    n -= 1
    i += 2
    while n > 0:
        if i % 4:
            print(i, end=" ")
            n -= 1
        i += 2
    print()


for _ in range(int(input())):
    n = int(input())
    evens = [x for x in range(4, 401) if x % 2 == 0]
    cur = []
    for num in evens:
        flag = True
        for elem in cur:
            if num % elem == 0:
                flag = False
        if flag:
            cur.append(num)
    print(*cur[:n])


for _ in range(int(input())):
    n = int(input())
    for i in range(n):
        print(2 * (i + 1), end=" ")
    print()


def sieve(n):
    num=[ True ]*(n+1)
    i=2
    primes=[]
    while i*i<n+1:
        if num[i]:
            j=i*i
            while j<=n:
                num[j]=False
                j+=i
        i+=1

    for i in range(2,n+1):
        if num[i]:
            primes.append(i)

    return primes

for _ in range(int(input())):
    n=int(input())
    p = sieve(2*n)
    b = []
    i = 0
    l = len(p)
    while i<l:
        j = i
        while j<l:
            b+=p[i]*p[j],
            j+=1

        i+=1

    print(*b[:n])


def isprime(n):
    if n<3:
        return n&1^1

    i = 2
    while i*i<=n:
        if n%i==0:
            return False
        i+=1

    return True

for _ in range(int(input())):
    n=int(input())
    b = []
    i = 2
    while i<=2*n:
        if isprime(i):
            b+=2*i,
        i+=1

    print(*b)


def sieve(n):
    num=[ True ]*(n+1)
    i=2
    primes=[]
    while i*i<n+1:
        if num[i]:
            j=i*i
            while j<=n:
                num[j]=False
                j+=i
        i+=1

    for i in range(2,n+1):
        if num[i]:
            primes.append(i)

    return primes

for _ in range(int(input())):
    n=int(input())
    p = sieve(4*n)
    # print(*p)
    b = []
    i = 0
    l = len(p)
    while i<l:
        j = i
        while j<l:
            if p[i]*p[j]<=4*n:
                b+=p[i]*p[j],
            # print("i , j :",i,j,p[i],p[j])
            j+=1

        i+=1

    print(*b[:n])


for _ in range(int(input())):
    n=int(input())
    a = [(4+2*i) for i in range(n)]
    print(*a)


for _ in range(int(input())):
    n=int(input())
    b = [(4*n-2*i) for i in range(n)]
    print(*b)


def gcd(a, b):
   c = min(a, b)
   d = max(a, b)
   for i in range(c, 0, -1):
       if d%i == 0:
           return i

def rec(n, m, x):
    global seating
    if m >= n:
        yes = True
        for i in range(n):
            if gcd(seating[i], seating[i-1]) == 1:
                yes = False
        if yes:
            return seating
    else:
        for i in range(4*n+1, x+1, -1):
            seating[m] = i
            r = rec(n, m+1, i)
            if not r is None:
                return r

for _ in range(int(input())):
    n = int(input())
    seating =[]
    for u in range(n):
        seating.append(0)
    for char in rec(n, 0, 1):
        print(char, end = ' ')


def gcd(a, b):
   c = min(a, b)
   d = max(a, b)
   for i in range(c, 0, -1):
       if d%i == 0:
           return i

def rec(n, m, x):
    global seating
    if m >= n:
        yes = True
        for i in range(n):
            if gcd(seating[i], seating[i-1]) == 1:
                yes = False
        if yes:
            return seating
    else:
        for i in range(4*n+1, x+1, -1):
            seating[m] = i
            r = rec(n, m+1, i)
            if not r is None:
                return r

for _ in range(int(input())):
    n = int(input())
    if n == 2:
        print(8, 6)
    else:
        seating =[]
        for u in range(n):
            seating.append(0)
        output = rec(n, 0, 1)
        for char in range(len(output)-1, -1, -1):
            print(output[char], end = ' ')
        print("\n", end = '')


def gcd(a, b):
   c = min(a, b)
   d = max(a, b)
   for i in range(c, 0, -1):
       if d%i == 0:
           return i

def rec(n, m, x):
    global seating
    if m >= n:
        yes = True
        for i in range(n):
            if gcd(seating[i], seating[i-1]) == 1:
                yes = False
        if yes:
            return seating
    else:
        for i in range(x+1, 4*n+1):
            seating[m] = i
            r = rec(n, m+1, i)
            if not r is None:
                return r

for _ in range(int(input())):
    n = int(input())
    seating =[]
    for u in range(n):
        seating.append(0)
    print(rec(n, 0, 1))


for _ in range(int(input())):
    n = int(input())
    for i in range(2*n, 4*n, 2):
        print(i, end=' ')
    print()


for test in range(int(input())):
    n = int(input())
    m = 2 * n
    chairs = []
    for i in range(n):
        chairs.append(m)
        m += 2


for test in range(int(input())):
    ch = int(input())
    ex = False
    i = 4
    chairs = [i]
    while not ex:
        ii = i + 2
        q = 0
        bad_ch = []
        for chair in chairs:
            if ii % chair == 0:
                q += 1
                bad_ch.append(chair)
        if q == 0:
            chairs.append(ii)
        i = ii
        if len(chairs) == ch:
            ex = True
    print(*chairs)


for test in range(int(input())):
    n = int(input())
    m = 2 * n
    chairs = []
    for i in range(n):
        chairs.append(m)
        m += 2
    print(*chairs)


t = int(input())
for _ in range(t):
    n = int(input())
    l = [n*4-2*x for x in range(x)]
    print (*l)


t = int(input())
for _ in range(t):
    n = int(input())
    print (*[2*(x+1) for x in range(n)])


t = int(input())
for _ in range(t):
    n = int(input())
    l = [n*4-2*x for x in range(n)]
    print (*l)


# Problem: A. Kids Seating
# Contest: Codeforces - Codeforces Round #681 (Div. 2, based on VK Cup 2019-2020 - Final)
# URL: https://codeforces.com/contest/1443/problem/0
# Memory Limit: 256 MB
# Time Limit: 2000 ms
#
# KAPOOR'S

from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def MOD():
    return pow(10,9)+7

def OPS(ans):
	stdout.write(str(ans)+"\n")

def OPL(ans):
	[stdout.write(str(_)+" ") for _ in ans]
	stdout.write("\n")

if __name__=="__main__":
	for _ in range(INI()):
	    n=INI()
	    for _ in range(n):
	    	print(2*(_+2),end=" ")
	    print()


# Problem: A. Kids Seating
# Contest: Codeforces - Codeforces Round #681 (Div. 2, based on VK Cup 2019-2020 - Final)
# URL: https://codeforces.com/contest/1443/problem/0
# Memory Limit: 256 MB
# Time Limit: 2000 ms
#
# KAPOOR'S

from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def MOD():
    return pow(10,9)+7

def OPS(ans):
	stdout.write(str(ans)+"\n")

def OPL(ans):
	[stdout.write(str(_)+" ") for _ in ans]
	stdout.write("\n")

if __name__=="__main__":
	t=INI()
	for _ in range(t):
	    n=INI()
	    i=1
	    x=4*n
	    while i<=n:
	    	print(x,end=" ")
	    	x-=2
	    	i+=1
	    print()


# Problem: A. Kids Seating
# Contest: Codeforces - Codeforces Round #681 (Div. 2, based on VK Cup 2019-2020 - Final)
# URL: https://codeforces.com/contest/1443/problem/0
# Memory Limit: 256 MB
# Time Limit: 2000 ms
#
# KAPOOR'S

from sys import stdin, stdout

def INI():
	return int(stdin.readline())

def INL():
	return [int(_) for _ in stdin.readline().split()]

def INS():
	return stdin.readline()

def MOD():
    return pow(10,9)+7

def OPS(ans):
	stdout.write(str(ans)+"\n")

def OPL(ans):
	[stdout.write(str(_)+" ") for _ in ans]
	stdout.write("\n")

if __name__=="__main__":
	for _ in range(INI()):
	    n=INI()
	    for _ in range(n):
	    	print(2*(_+1),end=" ")
	    print()


for i in range(int(input())):
    n = int(input())
    print(*list(range(2*n+2, 4*n+2, 2)))


def isprime(n):
    if n<=1:
        return False
    else:
        for j in range(2, int(n**0.5)+1):
            if n%j==0:
                return False
        return True
for i in range(int(input())):
    n = int(input())

    seats = []
    i = 2
    while len(seats) < n:
        if isprime(i):
            seats.append(i)
        i+=1

    print(*seats)


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll Max=5e9+10, N=5e5+10;

ll n,a[N],last,sim,psum[N];

int main(){
	cin>>n;
	for(ll i=1;i<=(n+1)/2;i++){
		scanf("%lld",&a[i]); psum[i]=psum[i-1]+a[i];
	}
	cin>>last;
	sim=(n+1)/2+1;
	for(ll i=sim;i<=n;i++) psum[i]=psum[i-1]+last;
	if(last>=0)
		if(psum[n]>0) cout<<n<<endl;
		else puts("-1");
	else{
		ll ans=Max;
		ll mlen=Max;
		for(ll i=1;i<=sim-1;i++){
			if(psum[sim-1]-psum[i-1]-1<=0) break;
			ans=min(ans,(psum[sim-1]-psum[i-1]-1)/(-last)+(sim-1-i+1));
			//这里psum[sim-1]-psum[i-1]分子要-1，因为刚好为0是非法的
			if(ans+i-1>=n){
				mlen=min(ans,n-i+1);
				//cout<<min(ans,n)<<endl; return 0;
				//注意min（ans，n）
			}
		}
		//if(ans+sim-1-1>=n) cout<<ans<<endl;
		//else
		if(mlen==Max)
			puts("-1");
		else cout<<mlen<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll Max=5e9+10, N=5e5+10;

ll n,a[N],last,sim,psum[N];

int main(){
	cin>>n;
	for(ll i=1;i<=(n+1)/2;i++){
		scanf("%lld",&a[i]); psum[i]=psum[i-1]+a[i];
	}
	cin>>last;
	sim=(n+1)/2+1;
	for(ll i=sim;i<=n;i++) psum[i]=psum[i-1]+last;
	if(last>=0)
		if(psum[n]>0) cout<<n<<endl;
		else puts("-1");
	else{
		ll ans=Max;
		for(ll i=1;i<=sim-1;i++){
			ans=min(ans,(psum[sim-1]-psum[i-1]-1)/(-last)+(sim-1-i+1));
			//这里psum[sim-1]-psum[i-1]分子要-1，因为刚好为0是非法的
			if(ans+i-1>=n){
				cout<<min(ans,n)<<endl; return 0;
				//注意min（ans，n）
			}
		}
		//if(ans+sim-1-1>=n) cout<<ans<<endl;
		//else
			puts("-1");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int Max=5e5+10, N=Max+10;

ll n,a[N],last,sim,psum[N];

int main(){
	cin>>n;
	for(ll i=1;i<=(n+1)/2;i++){
		scanf("%lld",&a[i]); psum[i]=psum[i-1]+a[i];
	}
	cin>>last;
	sim=(n+1)/2+1;
	for(ll i=sim;i<=n;i++) psum[i]=psum[i-1]+last;
	if(last>0)
		if(psum[n]>0) cout<<n<<endl;
		else puts("-1");
	else{
		ll ans=Max;
		for(ll i=1;i<=sim-1;i++){
			ans=min(ans,(psum[sim-1]-psum[i-1]-1)/(-last)+(sim-1-i+1));
			//这里psum[sim-1]-psum[i-1]分子要-1，因为刚好为0是非法的
		}
		if(ans+sim-1>=n) cout<<ans<<endl;
		else puts("-1");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll Max=5e9+10, N=5e5+10;

ll n,a[N],last,sim,psum[N];

int main(){
	cin>>n;
	for(ll i=1;i<=(n+1)/2;i++){
		scanf("%lld",&a[i]); psum[i]=psum[i-1]+a[i];
	}
	cin>>last;
	sim=(n+1)/2+1;
	for(ll i=sim;i<=n;i++) psum[i]=psum[i-1]+last;
	if(last>=0)
		if(psum[n]>0) cout<<n<<endl;
		else puts("-1");
	else{
		ll ans=Max;
		for(ll i=1;i<=sim-1;i++){
			ans=min(ans,(psum[sim-1]-psum[i-1]-1)/(-last)+(sim-1-i+1));
			//这里psum[sim-1]-psum[i-1]分子要-1，因为刚好为0是非法的
			/*if(ans+i-1>=n){
				cout<<min(ans,n)<<endl; return 0;
				//注意min（ans，n）
			} */
		}
		if(ans+sim-1-1>=n) cout<<min(ans,n)<<endl;
		else
			puts("-1");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll Max=5e9+10, N=5e5+10;

ll n,a[N],last,sim,psum[N];

int main(){
	cin>>n;
	for(ll i=1;i<=(n+1)/2;i++){
		scanf("%lld",&a[i]); psum[i]=psum[i-1]+a[i];
	}
	cin>>last;
	sim=(n+1)/2+1;
	for(ll i=sim;i<=n;i++) psum[i]=psum[i-1]+last;
	if(last>=0)
		if(psum[n]>0) cout<<n<<endl;
		else puts("-1");
	else{
		ll ans=Max;
		for(ll i=1;i<=sim-1;i++){
			ans=min(ans,(psum[sim-1]-psum[i-1]-1)/(-last)+(sim-1-i+1));
			//这里psum[sim-1]-psum[i-1]分子要-1，因为刚好为0是非法的
			if(ans+i-1>=n){
				cout<<ans<<endl; return 0;
			}
		}
		//if(ans+sim-1-1>=n) cout<<ans<<endl;
		//else
			puts("-1");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll Max=5e9+10, N=5e5+10;

ll n,a[N],last,sim,psum[N];

int main(){
	cin>>n;
	for(ll i=1;i<=(n+1)/2;i++){
		scanf("%lld",&a[i]); psum[i]=psum[i-1]+a[i];
	}
	cin>>last;
	sim=(n+1)/2+1;
	for(ll i=sim;i<=n;i++) psum[i]=psum[i-1]+last;
	if(last>0)
		if(psum[n]>0) cout<<n<<endl;
		else puts("-1");
	else{
		ll ans=Max;
		for(ll i=1;i<=sim-1;i++){
			ans=min(ans,(psum[sim-1]-psum[i-1]-1)/(-last)+(sim-1-i+1));
			//这里psum[sim-1]-psum[i-1]分子要-1，因为刚好为0是非法的
			if(ans+i-1>=n){
				cout<<ans<<endl; return 0;
			}
		}
		//if(ans+sim-1-1>=n) cout<<ans<<endl;
		//else
			puts("-1");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int Max=5e5+10, N=Max+10;

ll n,a[N],last,sim,psum[N];

int main(){
	cin>>n;
	for(ll i=1;i<=(n+1)/2;i++){
		scanf("%lld",&a[i]); psum[i]=psum[i-1]+a[i];
	}
	cin>>last;
	sim=(n+1)/2+1;
	for(ll i=sim;i<=n;i++) psum[i]=psum[i-1]+last;
	if(last>0)
		if(psum[n]>0) cout<<n<<endl;
		else puts("-1");
	else{
		ll ans=Max;
		for(ll i=1;i<=sim-1;i++){
			ans=min(ans,(psum[sim-1]-psum[i-1]-1)/(-last)+(sim-1-i+1));
			//这里psum[sim-1]-psum[i-1]分子要-1，因为刚好为0是非法的
			if(ans+i-1>=n){
				cout<<ans<<endl; return 0;
			}
		}
		//if(ans+sim-1-1>=n) cout<<ans<<endl;
		//else
			puts("-1");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll Max=5e9+10, N=5e5+10;

ll n,a[N],last,sim,psum[N];

int main(){
	cin>>n;
	for(ll i=1;i<=(n+1)/2;i++){
		scanf("%lld",&a[i]); psum[i]=psum[i-1]+a[i];
	}
	cin>>last;
	sim=(n+1)/2+1;
	for(ll i=sim;i<=n;i++) psum[i]=psum[i-1]+last;
	if(last>=0)
		if(psum[n]>0) cout<<n<<endl;
		else puts("-1");
	else{
		ll ans=Max;
		for(ll i=1;i<=sim-1;i++){
			if(psum[sim-1]-psum[i-1]-1<=0) break;
			ans=min(ans,(psum[sim-1]-psum[i-1]-1)/(-last)+(sim-1-i+1));
			//这里psum[sim-1]-psum[i-1]分子要-1，因为刚好为0是非法的
			if(ans+i-1>=n){
				cout<<min(ans,n)<<endl; return 0;
				//注意min（ans，n）
			}
		}
		//if(ans+sim-1-1>=n) cout<<ans<<endl;
		//else
			puts("-1");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define N 1000005
int T,n,a[N],X,x,s[N],mx[N],i,l,r,mid;
signed main(){
	cin>>n;X=(n+1)/2;
	for(i=1;i<=X+1;++i)cin>>a[i];
	for(i=X+2;i<=n;++i)a[i]=a[i-1];
	for(i=1;i<=n;++i)s[i]=s[i-1]+a[i];
	x=a[X+1];
	if(x<0){
		for(i=0;i<X;++i){
			l=X+1;r=n;
			while(l<r){
				mid=r-(r-l>>1);
				if(s[mid]>s[i])l=mid;
				else r=mid-1;
			}
			mx[i]=l;
		}
		for(i=1;i<X;++i){
		if(mx[i]<=i+X){cout<<"-1";return 0;}
		}
		cout<<X+1;
	}
	else{
		if(s[n]>0)cout<<n;
		else cout<<-1;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

const long long maxn = 5e5 + 10;
const long long inf = 1e18;

long long n;
long long K;
long long ans;
long long sum;
long long a[maxn];
long long seg[4 * maxn];
long long lazy[4 * maxn];

void in();
void solve();
void out();
void upd(long long, long long, long long, long long ,long long, long long);
long long get(long long, long long ,long long ,long long ,long long);
void push(long long);

int main(){
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    in();
    solve();
    out();
}

void in(){
    cin >> n;
    for(long long i = 0; i < (n + 1) / 2; i++)
        cin >> a[i];
    cin >> K;
}

void solve(){
    for(long long i = 0; i < (n + 1) / 2; i++){
        sum += a[i];
        upd(1, 0, n, 0, i + 1, a[i]);
    }
    if(K * (n / 2) + sum > 0){
        ans = n;
        return;
    }
    ans = -1;
    sum += K * (n / 2);
    for(long long i = 0; i < n / 2; i++){
        long long MX = K * (i + 1);
        MX = max(MX, get(1, 0, n, 0, i + 1));
        if(sum - MX > 0){
            ans = n - i - 1;
            return;
        }
        upd(1, 0, n, 0, i + 1, K);
    }
}

void upd(long long id, long long l, long long r, long long L, long long R, long long x){
    if(r <= L || R <= l)
        return;
    if(L <= l && r <= R){
        seg[id] += x;
        lazy[id] += x;
        return;
    }
    push(id);
    long long mid = (l + r) >> 1;
    upd(id << 1, l, mid, L, R, x);
    upd(id << 1 | 1, mid, r, L, R, x);
    seg[id] = max(seg[id << 1], seg[id << 1 | 1]);
}

long long get(long long id, long long l, long long r, long long L, long long R){
    if(r <= L || R <= l)
        return -inf;
    if(L <= l && r <= R)
        return seg[id];
    push(id);
    long long mid = (l + r) >> 1;
    return max(get(id << 1, l, mid, L, R), get(id << 1 | 1, mid, r, L, R));
}

void push(long long id){
    seg[id << 1] += lazy[id];
    seg[id << 1 | 1] += lazy[id];
    lazy[id << 1] += lazy[id];
    lazy[id << 1 | 1] += lazy[id];
    lazy[id] = 0;
}

void out(){
    cout << ans;
}


#include<bits/stdc++.h>
using namespace std;

const long long maxn = 5e5 + 10;
const long long inf = 1e18;

long long n;
long long K;
long long ans;
long long sum;
long long a[maxn];
long long seg[4 * maxn];
long long lazy[4 * maxn];

void in();
void solve();
void out();
void upd(long long, long long, long long, long long ,long long, long long);
long long get(long long, long long ,long long ,long long ,long long);
void push(long long);

int main(){
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    in();
    solve();
    out();
}

void in(){
    cin >> n;
    for(long long i = 0; i < (n + 1) / 2; i++)
        cin >> a[i];
    cin >> K;
}

void solve(){
    for(long long i = 0; i < (n + 1) / 2; i++){
        sum += a[i];
        upd(1, 0, n, i, n, a[i]);
    }
    if(K * (n / 2) + sum > 0){
        ans = n;
        return;
    }
    ans = -1;
    sum += K * (n / 2);
    for(long long i = 0; i < n / 2; i++){
        long long MX = K * (i + 1);
        MX = max(MX, get(1, 0, n, 0, i + 1));
        if(sum - MX > 0){
            ans = n - i - 1;
            return;
        }
        upd(1, 0, n, 0, i + 1, K);
    }
}

void upd(long long id, long long l, long long r, long long L, long long R, long long x){
    if(r <= L || R <= l)
        return;
    if(L <= l && r <= R){
        seg[id] += x;
        lazy[id] += x;
        return;
    }
    push(id);
    long long mid = (l + r) >> 1;
    upd(id << 1, l, mid, L, R, x);
    upd(id << 1 | 1, mid, r, L, R, x);
    seg[id] = max(seg[id << 1], seg[id << 1 | 1]);
}

long long get(long long id, long long l, long long r, long long L, long long R){
    if(r <= L || R <= l)
        return -inf;
    if(L <= l && r <= R)
        return seg[id];
    push(id);
    long long mid = (l + r) >> 1;
    return max(get(id << 1, l, mid, L, R), get(id << 1 | 1, mid, r, L, R));
}

void push(long long id){
    seg[id << 1] += lazy[id];
    seg[id << 1 | 1] += lazy[id];
    lazy[id << 1] += lazy[id];
    lazy[id << 1 | 1] += lazy[id];
    lazy[id] = 0;
}

void out(){
    cout << ans;
}


#include<bits/stdc++.h>
using namespace std;

const long long maxn = 5e5 + 10;
const long long inf = 1e18;

long long n;
long long K;
long long ans;
long long sum;
long long a[maxn];
long long seg[4 * maxn];
long long lazy[4 * maxn];

void in();
void solve();
void out();
void upd(long long, long long, long long, long long ,long long, long long);
long long get(long long, long long ,long long ,long long ,long long);
void push(long long);

int main(){
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    in();
    solve();
    out();
}

void in(){
    cin >> n;
    for(long long i = 0; i < (n + 1) / 2; i++)
        cin >> a[i];
    cin >> K;
}

void solve(){
    for(long long i = 0; i < n; i++){
        sum += a[i];
        upd(1, 0, n, i, i + 1, a[i]);
    }
    if(K * (n / 2) + sum > 0){
        ans = n;
        return;
    }
    ans = -1;
    sum += K * (n / 2);
    for(long long i = 0; i < n / 2; i++){
        long long MX = K * (i + 1);
        MX = max(MX, get(1, 0, n, 0, i + 1));
        if(sum - MX > 0){
            ans = n - i - 1;
            return;
        }
        upd(1, 0, n, 0, i + 1, K);
    }
}

void upd(long long id, long long l, long long r, long long L, long long R, long long x){
    if(r <= L || R <= l)
        return;
    if(L <= l && r <= R){
        seg[id] += x;
        lazy[id] += x;
        return;
    }
    push(id);
    long long mid = (l + r) >> 1;
    upd(id << 1, l, mid, L, R, x);
    upd(id << 1 | 1, mid, r, L, R, x);
    seg[id] = max(seg[id << 1], seg[id << 1 | 1]);
}

long long get(long long id, long long l, long long r, long long L, long long R){
    if(r <= L || R <= l)
        return -inf;
    if(L <= l && r <= R)
        return seg[id];
    push(id);
    long long mid = (l + r) >> 1;
    return max(get(id << 1, l, mid, L, R), get(id << 1 | 1, mid, r, L, R));
}

void push(long long id){
    seg[id << 1] += lazy[id];
    seg[id << 1 | 1] += lazy[id];
    lazy[id << 1] += lazy[id];
    lazy[id << 1 | 1] += lazy[id];
    lazy[id] = 0;
}

void out(){
    cout << ans;
}