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