#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, n;
  cin >> T;
  vector<vector<int>> out;
  for (int i = 0; i < T; i++) {
    vector<int> b;
    cin >> n;
    for (int j = 0; j < n / 2; j++) {
      int x, y;
      cin >> x >> y;
      b.push_back(y);
      b.push_back(-x);
    }
    out.push_back(b);
  }
  for (int i = 0; i < T; i++) {
    for (int j = 0; j < out[i].size(); j++) {
      cout << out[i][j] << " ";
    }
    cout << endl;
  }
}
