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