#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int c;
    cin >> c;
    for (int j = 0; j < c; j += 2) {
      int x, y, d;
      cin >> x >> y;
      cout << y << ' ' << -1 * x << ' ';
    }
    cout << endl;
  }
}
