description: 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.
solution: //package com.company;
  
  import java.io.*;
  import java.lang.reflect.Array;
  import java.text.DecimalFormat;
  import java.util.*;
  
  public class Main {
  
      static boolean[] primecheck = new boolean[1000002];
  
      public static void main(String[] args) throws IOException {
          OutputStream outputStream = System.out;
          FastReader in = new FastReader();
          PrintWriter out = new PrintWriter(outputStream);
          PROBLEM solver = new PROBLEM();
          int t = 1;
          t = in.nextInt();
          for (int i = 0; i < t; i++) {
              solver.solve(in, out);
          }
          out.close();
      }
  
      static class PROBLEM {
  
          public void solve(FastReader in, PrintWriter out) {
  
              int n = in.nextInt(), a[] = in.readArray(n);
              int[] b = new int[n];
  
              if((n&1) == 0){
                  for (int i = 0; i < n-1; i+=2) {
                      int gcd = gcd(Math.abs(a[i]), Math.abs(a[i+1]));
                      b[i] = a[i+1]/gcd;
                      b[i+1] = a[i]/gcd*-1;
                  }
              }else{
                  for (int i = 0; i < n-3; i+=2) {
                      int gcd = gcd(Math.abs(a[i]), Math.abs(a[i+1]));
                      b[i] = a[i+1]/gcd;
                      b[i+1] = a[i]/gcd*-1;
                  }
  
                  if(a[n-3] + a[n-2] != 0){
                      b[n-3] = -a[n-1];
                      b[n-2] = -a[n-1];
                      b[n-1] = a[n-3] + a[n-2];
                  }else if(a[n-2] + a[n-1] != 0){
                      b[n-3] = a[n-2] + a[n-1];
                      b[n-2] = -a[n-3];
                      b[n-1] = -a[n-3];
                  }else{
                      b[n-3] = -a[n-2];
                      b[n-2] = a[n-3] + a[n-1];
                      b[n-1] = -a[n-2];
                  }
              }
  
              for (int i = 0; i < n; i++) {
                  out.print(b[i] + " ");
              }
              out.println();
          }
      }
  
      static ArrayList<ArrayList<Integer>> createAdj(int n, int e){
  
          FastReader in = new FastReader();
          ArrayList<ArrayList<Integer>> adj = new ArrayList<>();
  
          for (int i = 0; i < n + 1; i++) {
              adj.add(new ArrayList<>());
          }
  
          for (int i = 0; i < e; i++) {
  
              int a = in.nextInt(), b = in.nextInt();
              System.out.println(a);
  
              adj.get(a).add(b);
              adj.get(b).add(a);
          }
  
  
          return adj;
      }
  
      static int binarySearch(int[] a, int l, int r, int x){
          if(r>=l){
              int mid = l + (r-l)/2;
  
              if(a[mid] == x) return mid;
  
              if(a[mid] > x) return binarySearch(a, l, mid-1, x);
              else return binarySearch(a,mid+1, r, x);
          }
          return -1;
      }
  
      static boolean isPalindromeI(int n){
  
          int d = 0;
          int y = n;
          while(y>0){
              d++;
              y/=10;
          }
  
          int[] a = new int[d];
          for (int i = 0; i < d; i++) {
              a[i] = n%10;
              n/=10;
          }
  
          System.out.println(Arrays.toString(a));
          for (int i = 0; i < d / 2; i++) {
              if(a[i] != a[d-i-1]) return false;
          }
          return true;
      }
  
      static int gcd(int a, int b) {
          if (b == 0) return a;
          return gcd(b, a % b);
      }
  
      static boolean isSquare(double a) {
          boolean isSq = false;
          double b = Math.sqrt(a);
          double c = Math.sqrt(a) - Math.floor(b);
  
          if (c == 0) isSq = true;
  
          return isSq;
      }
  
      static int exponentMod(int A, int B, int C) {
  
          // Base cases
          if (A == 0)
              return 0;
          if (B == 0)
              return 1;
  
          // If B is even
          long y;
          if (B % 2 == 0) {
              y = exponentMod(A, B / 2, C);
              y = (y * y) % C;
          }
  
          // If B is odd
          else {
              y = A % C;
              y = (y * exponentMod(A, B - 1, C) % C) % C;
          }
  
          return (int) ((y + C) % C);
      }
  
  
      static class Pair implements Comparable<Pair>{
  
          int x, y;
  
          Pair(int x, int y){
              this.x = x;
              this.y = y;
          }
  
          public int compareTo(Pair o){
              int ans = Integer.compare(y, o.y);
              //if(o.y == y) ans = Integer.compare(x, o.x);
  
              return ans;
          }
      }
  
      static class Tuple implements Comparable<Tuple>{
  
          int x, y, id;
  
          Tuple(int x, int y, int id){
              this.x = x;
              this.y = y;
              this.id = id;
          }
  
          public int compareTo(Tuple o){
              int ans = Integer.compare(x, o.x);
              if(o.x == x) ans = Integer.compare(y, o.y);
  
              return ans;
          }
      }
  
  //    public static class Pair<U extends Comparable<U>, V extends Comparable<V>> implements Comparable<Pair<U, V>> {
  //        public U x;
  //        public V y;
  //
  //        public Pair(U x, V y) {
  //            this.x = x;
  //            this.y = y;
  //        }
  //
  //        public int hashCode() {
  //            return (x == null ? 0 : x.hashCode() * 31) + (y == null ? 0 : y.hashCode());
  //        }
  //
  //        public boolean equals(Object o) {
  //            if (this == o)
  //                return true;
  //            if (o == null || getClass() != o.getClass())
  //                return false;
  //            Pair<U, V> p = (Pair<U, V>) o;
  //            return (x == null ? p.x == null : x.equals(p.x)) && (y == null ? p.y == null : y.equals(p.y));
  //        }
  //
  //        public int compareTo(Pair<U, V> b) {
  //            int cmpU = x.compareTo(b.x);
  //            return cmpU != 0 ? cmpU : y.compareTo(b.y);
  //        }
  //
  //        public String toString() {
  //            return String.format("(%s, %s)", x.toString(), y.toString());
  //        }
  //
  //    }
  
      static class FastReader {
          BufferedReader br;
          StringTokenizer st;
  
          public FastReader() {
              br = new BufferedReader(new InputStreamReader(System.in));
          }
  
          String next() {
              while (st == null || !st.hasMoreElements()) {
                  try {
                      st = new StringTokenizer(br.readLine());
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
              return st.nextToken();
          }
  
          int nextInt() {
              return Integer.parseInt(next());
          }
  
          long nextLong() {
              return Long.parseLong(next());
          }
  
          double nextDouble() {
              return Double.parseDouble(next());
          }
  
          char nextChar() {
              return next().charAt(0);
          }
  
          boolean nextBoolean() {
              return !(nextInt() == 0);
          }
          // boolean nextBoolean(){return Boolean.parseBoolean(next());}
  
          String nextLine() {
              String str = "";
              try {
                  str = br.readLine();
              } catch (IOException e) {
                  e.printStackTrace();
              }
              return str;
          }
  
          public int[] readArray(int size) {
              int[] array = new int[size];
              for (int i = 0; i < size; i++) array[i] = nextInt();
              return array;
          }
  
      }
  
      private static int[] mergeSort(int[] array) {
  
          //array.length replaced with ctr
          int ctr = array.length;
          if (ctr <= 1) {
              return array;
          }
  
          int midpoint = ctr / 2;
  
          int[] left = new int[midpoint];
          int[] right;
  
          if (ctr % 2 == 0) {
              right = new int[midpoint];
          } else {
              right = new int[midpoint + 1];
          }
  
          for (int i = 0; i < left.length; i++) {
              left[i] = array[i];
          }
  
          for (int i = 0; i < right.length; i++) {
              right[i] = array[i + midpoint];
          }
  
          int[] result = new int[array.length];
  
          left = mergeSort(left);
          right = mergeSort(right);
  
          result = merge(left, right);
  
          return result;
      }
  
      private static int[] merge(int[] left, int[] right) {
  
          int[] result = new int[left.length + right.length];
          int leftPointer = 0, rightPointer = 0, resultPointer = 0;
  
          while (leftPointer < left.length || rightPointer < right.length) {
  
              if (leftPointer < left.length && rightPointer < right.length) {
  
                  if (left[leftPointer] < right[rightPointer]) {
                      result[resultPointer++] = left[leftPointer++];
                  } else {
                      result[resultPointer++] = right[rightPointer++];
                  }
              } else if (leftPointer < left.length) {
                  result[resultPointer++] = left[leftPointer++];
              } else {
                  result[resultPointer++] = right[rightPointer++];
              }
          }
          return result;
      }
  
      public static void Sieve(int n) {
  
          Arrays.fill(primecheck, true);
          primecheck[0] = false;
          primecheck[1] = false;
  
          for (int i = 2; i * i < n + 1; i++) {
              if (primecheck[i]) {
                  for (int j = i * 2; j < n + 1; j += i) {
                      primecheck[j] = false;
                  }
              }
          }
      }
  }
  
  
  