#include <bits/stdc++.h>
using namespace ::std;
int main() {
  int t, n, a, b;
  cin >> t;
  for (int i1 = 0; i1 < t; i1++) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      b = a;
      cin >> a;
      if (i % 2 != 0) {
        cout << a << " ";
        cout << b * -1 << " ";
      }
    }
    cout << endl;
  }
}
