#include <bits/stdc++.h>
using namespace std;
signed main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    for (int i = 0; i < n; ++i) {
      if (i >= n / 2) {
        cout << a[n - 1 - i] << ' ';
      } else {
        cout << -a[n - 1 - i] << ' ';
      }
    }
    cout << '\n';
  }
  return 0;
}
