---
{"category_name":"easy","problem_code":"ADJHATE","problem_name":"Adjacency Hatred","problemComponents":{"constraints":"- $1 \\le T \\le 1000$\n- $2 \\le N \\le 500$\n- $1 \\le A_i \\le 10^6$\n","constraintsState":true,"subtasks":"- 30 points : $1 \\leq R \\leq 10000$\n- 70 points : $1 \\leq R \\leq 10^9$\n","subtasksState":false,"inputFormat":"- The first line contains an integer $T$ denoting the number of test cases. The $T$ test cases then follow.\n- The first line of each test case contains an integer $N$.\n- The second line of each test case contains $N$ space-separated integers $A_1, A_2, \\dots, A_N$.\n","inputFormatState":true,"outputFormat":"For each test case, print a single line containing $N$ integers denoting the modified array which is lovely, or `-1` if it is not possible.","outputFormatState":true,"sampleTestCases":{"0":{"id":1,"input":"2\n6\n3 7 10 1 2 12\n2\n1 3\n","output":"1 2 3 10 7 12\n-1\n","explanation":"- For the first test case, the sum is $|1-2| + |2-3| + |3-10| + |10-7| + |7-12| = 1+1+7+3+5 = 17$ which is odd.\n\n- For the second test case, $|1-3| = 2$ which is even. There is no array that can satisfy the above condition.","isDeleted":false}}},"video_editorial_url":"https://youtu.be/KWpIy58oCCg","languages_supported":{"0":"CPP14","1":"C","2":"JAVA","3":"PYTH 3.6","4":"CPP17","5":"PYTH","6":"PYP3","7":"CS2","8":"ADA","9":"PYPY","10":"TEXT","11":"PAS fpc","12":"NODEJS","13":"RUBY","14":"PHP","15":"GO","16":"HASK","17":"TCL","18":"PERL","19":"SCALA","20":"LUA","21":"kotlin","22":"BASH","23":"JS","24":"LISP sbcl","25":"rust","26":"PAS gpc","27":"BF","28":"CLOJ","29":"R","30":"D","31":"CAML","32":"FORT","33":"ASM","34":"swift","35":"FS","36":"WSPC","37":"LISP clisp","38":"SQL","39":"SCM guile","40":"PERL6","41":"ERL","42":"CLPS","43":"ICK","44":"NICE","45":"PRLG","46":"ICON","47":"COB","48":"SCM chicken","49":"PIKE","50":"SCM qobi","51":"ST","52":"SQLQ","53":"NEM"},"max_timelimit":1,"source_sizelimit":50000,"problem_author":"munch_01","problem_tester":"","date_added":"18-09-2021","tags":{"0":"cook133","1":"munch_01","2":"parity","3":"simple","4":"telescoping"},"problem_difficulty_level":"Simple","best_tag":"","editorial_url":"https://discuss.codechef.com/problems/ADJHATE","time":{"view_start_date":1632078002,"submit_start_date":1632078002,"visible_start_date":1632078002,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=ADJHATE","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
### Read problems statements in [Russian](https://www.codechef.com/download/translated/COOK133/russian/ADJHATE.pdf) and [Bengali](https://www.codechef.com/download/translated/COOK133/bengali/ADJHATE.pdf).
An array is called *lovely* if the sum of absolute differences of each adjacent pair of elements is odd; formally, the array $S$ of size $m$ is lovely if $\sum_{i=1}^{m-1}$ $|S_i-S_{i+1}|$ is odd.
You are given an array $A$ of $N$ integers. You need to reorder the array in any manner such that the array becomes lovely. If there is no reordering operation that makes the array lovely, output `-1`.
<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>