#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> mas;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      mas.push_back(x);
    }
    for (int i = 1; i < n; i += 2) {
      int now = abs(mas[i] * mas[i - 1]);
      int left = 1;
      if (mas[i] < 0 && mas[i - 1] < 0) {
        left = -1;
      }
      if (mas[i] > 0 && mas[i - 1] > 0) {
        left = -1;
      }
      cout << now / abs(mas[i - 1]) * left << " " << now / abs(mas[i]) << " ";
    }
    cout << endl;
  }
}
