#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> vec(n);
    for (int i = 0; i < n; ++i) {
      cin >> vec[i];
    }
    for (int i = 0; i < n; i++) {
      if (!(i % 2))
        cout << -vec[i + 1] << " ";
      else
        cout << vec[i - 1] << " ";
    }
    cout << endl;
  }
  return 0;
}
