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