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