#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (t; t > 0; t--) {
    int n;
    cin >> n;
    int m[n];
    for (int i = 0; i < n; i++) {
      cin >> m[i];
    }
    vector<int> ans(n, 1);
    for (int i = 0; i < n; i += 2) {
      ans[i] *= -1 * m[i + 1];
      ans[i + 1] *= m[i];
    }
    for (int i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
