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