#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n / 2; i++) {
    cout << -(a[n - i - 1]) << " ";
  }
  for (long long i = n / 2 - 1; i >= 0; i--) {
    cout << a[i] << " ";
  }
  cout << endl;
}
signed main() {
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
