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