#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (int i = n - 1; i >= n / 2; i--) {
      cout << -1 * a[i] << " ";
    }
    for (int i = n / 2 - 1; i >= 0; i--) cout << a[i] << " ";
    cout << "\n";
  }
}
