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: import java.io.*;
  import java.util.*;
  import java.lang.*;
  
  public class B {
      public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
      static long MOD = (long) (1e9 + 7);
      //static int MOD = 998244353;
      static long MOD2 = MOD * MOD;
      static FastReader sc = new FastReader();
      static int pInf = Integer.MAX_VALUE;
      static int nInf = Integer.MIN_VALUE;
      public static void main(String[] args) {
          int test = 1;
          test = sc.nextInt();
          for (int i = 1; i <= test; i++){
  //            out.print("Case #"+i+": ");
              solve();
          }
          out.flush();
          out.close();
      }
      static void solve(){
          int n = sc.nextInt();
          int[] a = new int[n];
          int[] b = new int[n];
          for(int i = 0; i < n; i++){
              a[i] = sc.nextInt();
          }
          if(n%2==0){
              for(int i = 0; i < n; i += 2){
                  int gcd = (int)gcd(a[i],a[i+1]);
                  b[i] = -1*(a[i+1]/gcd);
                  b[i+1] = (a[i]/gcd);
              }
          }else{
              for(int i = 3; i < n; i += 2){
                  int gcd = (int)gcd(a[i],a[i+1]);
                  b[i] = -1*(a[i+1]/gcd);
                  b[i+1] = (a[i]/gcd);
              }
              if(a[0]+a[1]!=0){
                  b[0] = -1*a[2];
                  b[1] = -1*a[2];
                  b[2] = (a[0]+a[1]);
              }else if(a[1]+a[2]!=0){
                  b[1] = -1*a[0];
                  b[2] = -1*a[0];
                  b[0] = (a[1]+a[2]);
              }else if(a[0]+a[2]!=0){
                  b[0] = -1*a[1];
                  b[2] = -1*a[1];
                  b[1] = (a[0]+a[2]);
              }
  
          }
          for(int x: b){
              out.print(x+" ");
          }
          out.println();
      }
      public static long mul(long a, long b) {
          return ((a % MOD) * (b % MOD)) % MOD;
      }
      public static long add(long a, long b) {
          return ((a % MOD) + (b % MOD)) % MOD;
      }
      public static long c2(long n) {
          if ((n & 1) == 0) {
              return mul(n / 2, n - 1);
          } else {
              return mul(n, (n - 1) / 2);
          }
      }
      //Pair Class
      static class Pair implements Comparable<Pair> {
          int x;
          int y;
          public Pair(int x, int y) {
              this.x = x;
              this.y = y;
          }
          @Override
          public int compareTo(Pair o) {
              if ((this.y == o.y)) {
                  return (this.x - o.x);
              }
              return -1*(this.y - o.y);
          }
  
          @Override
          public String toString() {
              return "Pair{" +
                      "x=" + x +
                      ", y=" + y +
                      '}';
          }
      }
      //Shuffle Sort
      static final Random random = new Random();
      static void ruffleSort(int[] a) {
          int n = a.length;//shuffle, then sort
          for (int i = 0; i < n; i++) {
              int oi = random.nextInt(n); int temp = a[oi];
              a[oi] = a[i];
              a[i] = temp;
          }
          Arrays.sort(a);
      }
      //Brian Kernighans Algorithm
      static long countSetBits(long n) {
          if (n == 0) return 0;
          return 1 + countSetBits(n & (n - 1));
      }
      //Euclidean Algorithm
      static long gcd(long A, long B) {
          if (B == 0) return A;
          return gcd(B, A % B);
      }
      //Modular Exponentiation
      static long fastExpo(long x, long n) {
          if (n == 0) return 1;
          if ((n & 1) == 0) return fastExpo((x * x) % MOD, n / 2) % MOD;
          return ((x % MOD) * fastExpo((x * x) % MOD, (n - 1) / 2)) % MOD;
      }
      //AKS Algorithm
      static boolean isPrime(long n) {
          if (n <= 1) return false;
          if (n <= 3) return true;
          if (n % 2 == 0 || n % 3 == 0) return false;
          for (int i = 5; i <= Math.sqrt(n); i += 6)
              if (n % i == 0 || n % (i + 2) == 0) return false;
          return true;
      }
      public static long modinv(long x) {
          return modpow(x, MOD - 2);
      }
      public static long modpow(long a, long b) {
          if (b == 0) {
              return 1;
          }
          long x = modpow(a, b / 2);
          x = (x * x) % MOD;
          if (b % 2 == 1) {
              return (x * a) % MOD;
          }
          return x;
      }
  
      public static class FastReader {
          BufferedReader br;
          StringTokenizer st;
          //it reads the data about the specified point and divide the data about it ,it is quite fast
          //than using direct
  
          public FastReader() {
              br = new BufferedReader(new InputStreamReader(System.in));
          }
  
          String next() {
              while (st == null || !st.hasMoreTokens()) {
                  try {
                      st = new StringTokenizer(br.readLine());
                  } catch (Exception r) {
                      r.printStackTrace();
                  }
              }
              return st.nextToken();
          }
  
          int nextInt() {
              return Integer.parseInt(next());//converts string to integer
          }
  
          double nextDouble() {
              return Double.parseDouble(next());
          }
  
          long nextLong() {
              return Long.parseLong(next());
          }
  
          String nextLine() {
              String str = "";
              try {
                  str = br.readLine();
              } catch (Exception r) {
                  r.printStackTrace();
              }
              return str;
          }
      }
  }