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