#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
void solve() {
  int n;
  cin >> n;
  ll a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    cout << a[n - i - 1] * (i < n / 2 ? -1 : 1) << ' ';
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << '\n';
  }
}
