#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  while (n--) {
    long long int t;
    cin >> t;
    long long int ar[t];
    for (long long int i = 0; i < t; i++) {
      cin >> ar[i];
    }
    for (long long int j = 0; j < t; j++) {
      if (j % 2 == 0) {
        if (ar[j] > 0) {
          cout << abs(ar[j + 1]) << " ";
        } else
          cout << -abs(ar[j + 1]) << " ";
      } else {
        if (ar[j] > 0)
          cout << -abs(ar[j - 1]) << " ";
        else
          cout << abs(ar[j - 1]) << " ";
      }
    }
    cout << endl;
  }
  return 0;
}
