#include <bits/stdc++.h>
const int sz = 1e5 + 9;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long ar[n], ar2[n], sm = 0;
    for (int i = 0; i < n; i++) {
      cin >> ar[i];
      ar2[i] = ar[i];
    }
    reverse(ar2, ar2 + n);
    for (int i = 0; i < n / 2; i++) {
      cout << -ar2[i] << " ";
    }
    for (int i = (n / 2) - 1; i >= 0; i--) {
      cout << ar[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
