#include <bits/stdc++.h>
using namespace std;
int input() {
  int t;
  cin >> t;
  return t;
}
vector<int> input(int n) {
  vector<int> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  return v;
}
void print(vector<int>& v) {
  for (int u : v) cout << u << ' ';
  cout << endl;
}
void solve() {
  int n = input();
  vector<int> a = input(n);
  for (int i = n / 2; i < n; ++i) cout << a[i] << ' ';
  for (int i = 0; i < n / 2; ++i) cout << -a[i] << ' ';
  cout << endl;
}
int main() {
  int t = input();
  for (int i = 0; i < t; ++i) solve();
  return 0;
}
