def construct_doubled_sequence(N):
if N % 2 == 1:
return "-1" # No valid sequence for odd N
# For even N, construct the sequence
sequence = []
for i in range(1, N + 1):
sequence.append(i)
sequence.append(i)
# We need to rearrange to satisfy the distance condition
# A simple method is to interleave the pairs
result = []
for i in range(1, N + 1):
result.append(i)
result.append(i)
# A pattern to ensure that it meets the doubled condition
# Let's rearrange it as:
for i in range(1, N + 1):
result[i - 1], result[2 * i - 1] = result[2 * i - 1], result[i - 1]
return ' '.join(map(str, result))
def main():
import sys
input = sys.stdin.read
data = input().strip().split()
T = int(data[0])
results = []
for i in range(1, T + 1):
N = int(data[i])
results.append(construct_doubled_sequence(N))
print('\n'.join(results))
if __name__ == "__main__":
main()
ZGVmIGNvbnN0cnVjdF9kb3VibGVkX3NlcXVlbmNlKE4pOgogICAgaWYgTiAlIDIgPT0gMToKICAgICAgICByZXR1cm4gIi0xIiAgIyBObyB2YWxpZCBzZXF1ZW5jZSBmb3Igb2RkIE4KICAgIAogICAgIyBGb3IgZXZlbiBOLCBjb25zdHJ1Y3QgdGhlIHNlcXVlbmNlCiAgICBzZXF1ZW5jZSA9IFtdCiAgICBmb3IgaSBpbiByYW5nZSgxLCBOICsgMSk6CiAgICAgICAgc2VxdWVuY2UuYXBwZW5kKGkpCiAgICAgICAgc2VxdWVuY2UuYXBwZW5kKGkpCiAgICAKICAgICMgV2UgbmVlZCB0byByZWFycmFuZ2UgdG8gc2F0aXNmeSB0aGUgZGlzdGFuY2UgY29uZGl0aW9uCiAgICAjIEEgc2ltcGxlIG1ldGhvZCBpcyB0byBpbnRlcmxlYXZlIHRoZSBwYWlycwogICAgcmVzdWx0ID0gW10KICAgIGZvciBpIGluIHJhbmdlKDEsIE4gKyAxKToKICAgICAgICByZXN1bHQuYXBwZW5kKGkpCiAgICAgICAgcmVzdWx0LmFwcGVuZChpKQoKICAgICMgQSBwYXR0ZXJuIHRvIGVuc3VyZSB0aGF0IGl0IG1lZXRzIHRoZSBkb3VibGVkIGNvbmRpdGlvbgogICA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