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