Codeforces Question

https://codeforces.com/contest/977/problem/D
i am not able understand the question

particularly this test case
input
6
4 8 6 3 12 9
output
9 3 6 12 4 8