#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int &i : a) cin >> i;
  vector<int> b = a;
  reverse(b.begin(), b.end());
  for (__typeof(n) i = (0); i < (n); i++) {
    if (i % 2 == 0) {
      cout << -b[i] << ' ';
    } else {
      cout << b[i] << ' ';
    }
  }
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) solve();
}
