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