#include <bits/stdc++.h>
using namespace std;
long long TN = 1;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    long long k = a[i], m = a[n - 1 - i];
    if (i % 2 == 0) {
      if (a[i] > 0)
        cout << abs(m) * -1 << " ";
      else
        cout << abs(m) << " ";
    } else {
      if (a[i] < 0)
        cout << abs(m) * -1 << " ";
      else
        cout << abs(m) << " ";
    }
  }
  cout << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> TN;
  for (int i = 0; i < TN; ++i) {
    solve();
  }
  return 0;
}
