#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int testCaseCount;
  cin >> testCaseCount;
  while (testCaseCount--) {
    int sealsCount;
    cin >> sealsCount;
    sealsCount /= 2;
    int a, b;
    while (sealsCount--) {
      cin >> a >> b;
      cout << -b << " " << a << " ";
    }
    cout << endl;
  }
  return 0;
}
