#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++) cin >> arr[i];
    int b[n];
    for (int i = 0; i < n / 2; i++) {
      b[i] = -arr[n - i - 1];
      b[n - 1 - i] = arr[i];
    }
    for (int i = 0; i < n; i++) cout << b[i] << " ";
    cout << endl;
  }
  return 0;
}
