#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e9;
const long long inf = (long long)4e18;
const long double eps = (long double)1e-12;
const long long mod = (long long)1e9 + 7;
const long long mod2 = (long long)1e9 + 9;
const long long MAXN = (long long)1e5 + 1;
const long long MAXC = (long long)1e6 + 10;
const long long MAXE = (long long)1000;
const long long MAXLOG = (long long)19;
const long long maxlen = (long long)1e5;
const long long asci = (long long)256;
const long long block = 512;
const long double PI = acos(-1LL);
const long double e = 2.7182818284;
template <class T>
istream &operator>>(istream &in, vector<T> &arr) {
  for (T &cnt : arr) {
    in >> cnt;
  }
  return in;
};
void solve() {
  int n;
  cin >> n;
  vector<long long> a(n);
  cin >> a;
  vector<long long> b(n);
  for (int i = 0; i < n; i += 2) {
    b[i + 1] = -a[i];
    b[i] = a[i + 1];
  }
  for (int i = 0; i < n; ++i) {
    cout << b[i] << " ";
  }
  cout << "\n";
}
signed main() {
  srand(time(0));
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(30);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
