#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, i;
  cin >> n;
  int a[n];
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n / 2; i++) cout << -1 * (a[n - i + 1]) << " ";
  for (i = (n / 2) + 1; i <= n; i++) cout << a[n - i + 1] << " ";
  cout << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
