#include <bits/stdc++.h>
using namespace std;
void result(int a, int b) {
  if (a > b) {
    cout << b << " " << -a << " ";
  }
  if (a < b) {
    cout << -b << " " << a << " ";
  }
  if (a == b) {
    cout << -1 << " " << 1 << " ";
  }
}
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int j = 0; j < n; j++) {
      cin >> a[j];
    }
    for (int j = 0; j < n - 1; j += 2) {
      result(a[j], a[j + 1]);
    }
    cout << endl;
  }
}
