#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    vector<int> ans(n);
    for (int i = 0; i < n / 2; i++) {
      ans[i] = v[n - 1 - i];
      ans[n - 1 - i] = -1 * v[i];
    }
    for (int ele : ans) cout << ele << " ";
    cout << endl;
  }
  return 0;
}
