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