{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003ca href\u003d\"https://codeforces.com/problemset/problem/1632/B\"\u003eProblem Link\u003c/a\u003e"}},{"title":"","value":{"format":"HTML","content":"\u003cp\u003eIt has finally been decided to build a roof over the football field in School 179. Its construction will require placing $$$n$$$ consecutive vertical pillars. Furthermore, the headmaster wants the heights of all the pillars to form a permutation $$$p$$$ of integers from $$$0$$$ to $$$n - 1$$$, where $$$p_i$$$ is the height of the $$$i$$$-th pillar from the left $$$(1 \\le i \\le n)$$$.\u003c/p\u003e\u003cp\u003eAs the chief, you know that the cost of construction of consecutive pillars is equal to \u003cspan class\u003d\"tex-font-style-bf\"\u003ethe maximum value of the bitwise XOR\u003c/span\u003e of heights of all pairs of adjacent pillars. In other words, the cost of construction is equal to $$$\\max\\limits_{1 \\le i \\le n - 1}{p_i \\oplus p_{i + 1}}$$$, where $$$\\oplus$$$ denotes the \u003ca href\u003d\"https://en.wikipedia.org/wiki/Bitwise_operation#XOR\"\u003ebitwise XOR operation\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eFind any sequence of pillar heights $$$p$$$ of length $$$n$$$ with the smallest construction cost.\u003c/p\u003e\u003cp\u003eIn this problem, a permutation is an array consisting of $$$n$$$ distinct integers from $$$0$$$ to $$$n - 1$$$ in arbitrary order. For example, $$$[2,3,1,0,4]$$$ is a permutation, but $$$[1,0,1]$$$ is not a permutation ($$$1$$$ appears twice in the array) and $$$[1,0,3]$$$ is also not a permutation ($$$n\u003d3$$$, but $$$3$$$ is in the array).\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eEach test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \\le t \\le 10^4$$$). Description of the test cases follows.\u003c/p\u003e\u003cp\u003eThe only line for each test case contains a single integer $$$n$$$ ($$$2 \\le n \\le 2 \\cdot 10^5$$$) — the number of pillars for the construction of the roof.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \\cdot 10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case print $$$n$$$ integers $$$p_1$$$, $$$p_2$$$, $$$\\ldots$$$, $$$p_n$$$ — the sequence of pillar heights with the smallest construction cost.\u003c/p\u003e\u003cp\u003eIf there are multiple answers, print any of them.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n2\n3\n5\n10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0 1\n2 0 1\n3 2 1 0 4\n4 6 3 2 0 8 9 1 7 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eFor $$$n \u003d 2$$$ there are $$$2$$$ sequences of pillar heights: \u003c/p\u003e\u003cul\u003e \u003cli\u003e $$$[0, 1]$$$ — cost of construction is $$$0 \\oplus 1 \u003d 1$$$. \u003c/li\u003e\u003cli\u003e $$$[1, 0]$$$ — cost of construction is $$$1 \\oplus 0 \u003d 1$$$. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eFor $$$n \u003d 3$$$ there are $$$6$$$ sequences of pillar heights: \u003c/p\u003e\u003cul\u003e \u003cli\u003e $$$[0, 1, 2]$$$ — cost of construction is $$$\\max(0 \\oplus 1, 1 \\oplus 2) \u003d \\max(1, 3) \u003d 3$$$. \u003c/li\u003e\u003cli\u003e $$$[0, 2, 1]$$$ — cost of construction is $$$\\max(0 \\oplus 2, 2 \\oplus 1) \u003d \\max(2, 3) \u003d 3$$$. \u003c/li\u003e\u003cli\u003e $$$[1, 0, 2]$$$ — cost of construction is $$$\\max(1 \\oplus 0, 0 \\oplus 2) \u003d \\max(1, 2) \u003d 2$$$. \u003c/li\u003e\u003cli\u003e $$$[1, 2, 0]$$$ — cost of construction is $$$\\max(1 \\oplus 2, 2 \\oplus 0) \u003d \\max(3, 2) \u003d 3$$$. \u003c/li\u003e\u003cli\u003e $$$[2, 0, 1]$$$ — cost of construction is $$$\\max(2 \\oplus 0, 0 \\oplus 1) \u003d \\max(2, 1) \u003d 2$$$. \u003c/li\u003e\u003cli\u003e $$$[2, 1, 0]$$$ — cost of construction is $$$\\max(2 \\oplus 1, 1 \\oplus 0) \u003d \\max(3, 1) \u003d 3$$$. \u003c/li\u003e\u003c/ul\u003e"}}]}