#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
void solve() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    swap(a[i], a[i + 1]);
    i = i + 1;
  }
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      cout << -1 * a[i] << " ";
    else
      cout << a[i] << " ";
  }
  cout << endl;
}
