#include <bits/stdc++.h>
int main() {
  using std::cout, std::cin, std::endl;
  int rooms, seals, power[2];
  cin >> rooms;
  while (rooms--) {
    cin >> seals;
    for (int i = 0; i < seals; i += 2) {
      cin >> power[0];
      cin >> power[1];
      cout << -power[1] << " " << power[0] << " ";
    }
    cout << endl;
  }
  return 0;
}
