#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n;
  for (int k = 0; k < n; k++) {
    cin >> m;
    for (int i = 0; i < m / 2; i++) {
      int fir, sec;
      cin >> fir >> sec;
      if (fir > 0 && sec > 0) {
        cout << sec << " " << -fir << " ";
      } else if (fir < 0 && sec < 0) {
        cout << -sec << " " << fir << " ";
      } else if (fir > 0 && sec < 0) {
        cout << -sec << " " << fir << " ";
      } else if (fir < 0 && sec > 0) {
        cout << sec << " " << -fir << " ";
      }
    }
    cout << endl;
  }
}
