#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  for (long long int i = 0; i < t; i++) {
    long long int n;
    cin >> n;
    long long int input[n];
    for (long long int j = 0; j < n; j++) cin >> input[j];
    for (long long int j = 0; j < n; j++) {
      if (j < n / 2)
        cout << -1 * input[n - 1 - j] << " ";
      else
        cout << input[n - 1 - j] << " ";
    }
    cout << endl;
  }
  return 0;
}
