Chef loves saving money and he trusts none other bank than State Bank of Chefland. Unsurprisingly, the employees like giving a hard time to their customers. But instead of asking them to stand them in long queues, they have weird way of accepting money.
Chef did his homework and found that the bank only accepts the money in coins such that the sum of the denomination with any previously deposited coin OR itself can't be obtained by summing any two coins OR double of any coin deposited before. Considering it all, he decided to start with $1$ Chefland rupee and he would keep choosing smallest possible denominations upto $N$ coins. Since chef is busy with his cooking, can you find out the $N$ denomination of coins chef would have to take to the bank? Also find the total sum of money of those $N$ coins.

-----Input:-----
- First line has a single integer $T$ i.e. number of testcases.
- $T$ lines followed, would have a single integer $N$ i.e. the number of coins the chef is taking.

-----Output:-----
- Output for $i$-th testcase ($1 ≤ i ≤ T$) would have 2 lines.
- First line would contain $N$ integers i.e. the denomination of coins chef would deposit to the bank.
- Second line would contain a single integer i.e. the sum of all the coins chef would deposit.

-----Constraints:-----
- $1 ≤ T ≤ 700$
- $1 ≤ N ≤ 700$

-----Subtasks:-----
- $20$ points: $1 ≤ T, N ≤ 80$
- $70$ points: $1 ≤ T, N ≤ 500$
- $10$ points: $1 ≤ T, N ≤ 700$ 

-----Sample Input:-----
4
1
2
3
4

-----Sample Output:-----
1
1
1 2
3
1 2 4
7
1 2 4 8
15

-----Explanation:-----
For testcase 1: First coin is stated to be 1, hence for $N$ = 1, 1 is the answer.
For testcase 2: Since chef chooses the lowest possible denomination for each $i$-th coin upto $N$ coins, second coin would be 2. Only sum possible with N = 1 would be 1+1 = 2. For N = 2, $\{1+2,  2+2\}$ $\neq$ $2$.
For testcase 3: With first two coins being 1 and 2, next coin couldn't be 3 because 3+1 = 2+2, but $\{4+1,  4+2,  4+4\}$ $\neq$ $\{1+1,  1+2,  2+2\}$

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = " \r\nfrom itertools import (islice)\r\n \r\ndef mianChowlas():\r\n    '''Mian-Chowla series - Generator constructor\r\n    '''\r\n    mcs = [1]\r\n    sumSet = set([2])\r\n    x = 1\r\n    while True:\r\n        yield x\r\n        (sumSet, mcs, x) = nextMC(sumSet, mcs, x)\r\ndef nextMC(setSums, mcs, n):\r\n    def valid(x):\r\n        for m in mcs:\r\n            if x + m in setSums:\r\n                return False\r\n        return True\r\n \r\n    x = until(valid)(succ)(n)\r\n    setSums.update(\r\n        [x + y for y in mcs] + [2 * x]\r\n    )\r\n    return (setSums, mcs + [x], x)\r\n \r\n \r\ndef main(t):\r\n    genMianChowlas = mianChowlas()\r\n    n = int(input())\r\n    k=take(n)(genMianChowlas)\r\n    print(*k)\r\n    print(sum(k))\r\n    \r\n    if t>1:\r\n        main(t-1)\r\n\r\n \r\ndef drop(n):\r\n    '''The suffix of xs after the\r\n       first n elements, or [] if n > length xs'''\r\n    def go(xs):\r\n        if isinstance(xs, list):\r\n            return xs[n:]\r\n        else:\r\n            take(n)(xs)\r\n            return xs\r\n    return lambda xs: go(xs)\r\n \r\ndef succ(x):\r\n    return 1 + x\r\n \r\n \r\ndef take(n):\r\n    '''The prefix of xs of length n,\r\n       or xs itself if n > length xs.'''\r\n    return lambda xs: (\r\n        xs[0:n]\r\n        if isinstance(xs, list)\r\n        else list(islice(xs, n))\r\n    )\r\n \r\n \r\ndef until(p):\r\n    def go(f, x):\r\n        v = x\r\n        while not p(v):\r\n            v = f(v)\r\n        return v\r\n    return lambda f: lambda x: go(f, x)\r\n \r\n \r\ndef __starting_point():\r\n    main(int(input()))\n__starting_point()"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14519