Vupsen and Pupsen were gifted an integer array. Since Vupsen doesn't like the number 0, he threw away all numbers equal to 0 from the array. As a result, he got an array a of length n.

Pupsen, on the contrary, likes the number 0 and he got upset when he saw the array without zeroes. To cheer Pupsen up, Vupsen decided to come up with another array b of length n such that ∑_{i=1}^{n}a_i ⋅ b_i=0. Since Vupsen doesn't like number 0, the array b must not contain numbers equal to 0. Also, the numbers in that array must not be huge, so the sum of their absolute values cannot exceed 10^9. Please help Vupsen to find any such array b!

Input

The first line contains a single integer t (1 ≤ t ≤ 100) — the number of test cases. The next 2 ⋅ t lines contain the description of test cases. The description of each test case consists of two lines.

The first line of each test case contains a single integer n (2 ≤ n ≤ 10^5) — the length of the array.

The second line contains n integers a_1, a_2, …, a_n (-10^4 ≤ a_i ≤ 10^4, a_i ≠ 0) — the elements of the array a.

It is guaranteed that the sum of n over all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case print n integers b_1, b_2, …, b_n — elements of the array b (|b_1|+|b_2|+… +|b_n| ≤ 10^9, b_i ≠ 0, ∑_{i=1}^{n}a_i ⋅ b_i=0).

It can be shown that the answer always exists.

Example

Input


3
2
5 5
5
5 -2 10 -9 4
7
1 2 3 4 5 6 7


Output


1 -1
-1 5 1 -1 -1
-10 2 2 -3 5 -1 -1

Note

In the first test case, 5 ⋅ 1 + 5 ⋅ (-1)=5-5=0. You could also print 3 -3, for example, since 5 ⋅ 3 + 5 ⋅ (-3)=15-15=0

In the second test case, 5 ⋅ (-1) + (-2) ⋅ 5 + 10 ⋅ 1 + (-9) ⋅ (-1) + 4 ⋅ (-1)=-5-10+10+9-4=0.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Comparator;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DVupsenPupsenI0 solver = new DVupsenPupsenI0();
        int testCount = Integer.parseInt(in.next());
        for (int i = 1; i <= testCount; i++)
            solver.solve(i, in, out);
        out.close();
    }

    static class DVupsenPupsenI0 {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            ArrayList<Pair<Integer, Integer>> a = new ArrayList<>();
            int[] b = new int[n];
            for (int i = 0; i < n; i++) {
                int val = in.nextInt();
                b[i] = val;
                a.add(Pair.of(i, val));
            }
            a.sort(Comparator.comparingInt(x -> x.sc));
            int[] ans = new int[n];

            if (n % 2 == 1) {
                boolean found = false;
                int j = -1;
                for (int i = 2; i < n; i++) {
                    if (a.get(i - 2).sc == a.get(i).sc) {
                        found = true;
                        ans[a.get(i - 2).fs] = 2;
                        ans[a.get(i - 1).fs] = -1;
                        ans[a.get(i).fs] = -1;
                        j = i;
                        break;
                    }
                }
                if (found) {
                    a.remove(j);
                    a.remove(j - 1);
                    a.remove(j - 2);
                } else {
                    Pair<Integer, Integer> j1 = a.get(n - 1);
                    Pair<Integer, Integer> j2 = a.get(n - 2);
                    Pair<Integer, Integer> j3 = a.get(n - 3);
                    int s1 = j1.sc + j2.sc;
                    if (s1 == 0) {
                        Pair<Integer, Integer> z = j1;
                        j1 = j3;
                        j3 = z;
                        s1 = j1.sc + j2.sc;
                    }
                    int s2 = j3.sc;

                    ans[j1.fs] = -s2;
                    ans[j2.fs] = -s2;
                    ans[j3.fs] = s1;
                    a.remove(a.size() - 1);
                    a.remove(a.size() - 1);
                    a.remove(a.size() - 1);
                }
            }
            for (int i = 1; i < a.size(); i += 2) {
                Pair<Integer, Integer> j1 = a.get(i - 1);
                Pair<Integer, Integer> j2 = a.get(i);
                ans[j1.fs] += -j2.sc;
                ans[j2.fs] += j1.sc;
            }

            int ssum = 0;


            for (int i = 0; i < n; i++) {
                ssum += ans[i] * b[i];
                out.print(ans[i] + " ");
            }
            out.println();
//        out.println(ssum);


        }

    }

    static class Pair<T, K> {
        T fs;
        K sc;

        public Pair(T fs, K sc) {
            this.fs = fs;
            this.sc = sc;
        }

        public static <T, K> Pair<T, K> of(T fs, K sc) {
            return new Pair<>(fs, sc);
        }

        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (o == null || getClass() != o.getClass()) {
                return false;
            }
            Pair<?, ?> pair = (Pair<?, ?>) o;
            return Objects.equals(fs, pair.fs) && Objects.equals(sc, pair.sc);
        }

        public int hashCode() {
            return Objects.hash(fs, sc);
        }

    }

    static class InputReader {
        private static final int BUFFER_LENGTH = 1 << 10;
        private InputStream stream;
        private byte[] buf = new byte[BUFFER_LENGTH];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int nextC() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String next() {
            int c = nextC();
            while (isSpaceChar(c)) {
                c = nextC();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.append((char) c);
                c = nextC();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public int nextInt() {
            int c = skipWhileSpace();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = nextC();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = nextC();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int skipWhileSpace() {
            int c = nextC();
            while (isSpaceChar(c)) {
                c = nextC();
            }
            return c;
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

