#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i += 2) {
    int a, b;
    cin >> a >> b;
    cout << -b << " " << a << " ";
  }
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tst = 1;
  cin >> tst;
  while (tst--) solve();
  return 0;
}
