#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (auto& elem : v) cin >> elem;
  for (int i = 0; i < n - 1; i += 2) {
    v[i] = -v[i];
    swap(v[i], v[i + 1]);
  }
  for (auto& elem : v) cout << elem << " ";
  cout << endl;
}
int main() {
  int q;
  cin >> q;
  while (q--) {
    solve();
  }
}
