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