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