#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n + 1];
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = n; i > (n / 2); i--) cout << a[i] << ' ';
    for (int i = (n / 2); i >= 1; i--) cout << -a[i] << ' ';
    cout << '\n';
  }
}
