#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int j = 0; j < t; j++) {
    int n;
    cin >> n;
    int p[n];
    for (int i = 0; i < n; i++) {
      cin >> p[i];
    }
    for (int i = 0; i < n / 2; i++) {
      if (p[i] >= p[n - i - 1]) {
        cout << p[n - 1 - i] << " ";
      } else {
        cout << -p[n - 1 - i] << " ";
      }
    }
    for (int i = n / 2; i < n; i++) {
      if (p[i] <= p[n - i - 1]) {
        cout << -p[n - 1 - i] << " ";
      } else {
        cout << p[n - 1 - i] << " ";
      }
    }
  }
}
