#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
FILE* stream;
mt19937 rng(1337);
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < int(n); i++) {
    cin >> a[i];
  }
  vector<int> b(n);
  for (int i = 0; i < int(n); i++) {
    if (i % 2) {
      b[i] = a[i - 1];
    } else {
      b[i] = -a[i + 1];
    }
  }
  for (int i = 0; i < int(n); i++) cout << b[i] << ' ';
  cout << endl;
  return;
}
signed main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
