#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <class T>
bool ckmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
bool ckmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
const int N = 2e5 + 500;
const int mod = 1e9 + 7;
const int INF = INT_MAX >> 1;
const ll LINF = LLONG_MAX >> 1;
const ld eps = 1e-9;
void solve() {
  int n;
  cin >> n;
  int m = n / 2;
  vector<int> a(n);
  for (auto &e : a) cin >> e;
  vector<int> b(n);
  for (int i = 0; i < m; i++) {
    if (a[i] > 0)
      b[i] = (a[i + m] > 0 ? a[i + m] : -a[i + m]);
    else
      b[i] = -(a[i + m] > 0 ? a[i + m] : -a[i + m]);
  }
  for (int i = m; i < n; i++) {
    if (a[i] > 0)
      b[i] = -(a[i - m] > 0 ? a[i - m] : -a[i - m]);
    else
      b[i] = (a[i - m] > 0 ? a[i - m] : -a[i - m]);
  }
  for (int i = 0; i < n; i++) cout << b[i] << ' ';
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(20);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
