#include <bits/stdc++.h>
using namespace std;
int t;
void solve() {
  int n;
  vector<int> v;
  for (int i = 0; i < t; i++) {
    cin >> n;
    v.resize(n);
    for (int& e : v) cin >> e;
    for (int j = 0; j < n / 2; j++) {
      cout << v[n - 1 - j] << " ";
    }
    for (int j = n / 2; j < n; j++) {
      cout << -v[n - 1 - j] << " ";
    }
    cout << endl;
  }
  return;
}
int main() {
  cin >> t;
  ;
  solve();
  ;
  return 0;
}
