#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 9;
const int N = 1e2 + 5;
const long double EPS = 1e-12;
const int P = 239017;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    int n, a[N];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i += 2) {
      int need = a[i] * a[i + 1];
      cout << -a[i + 1] << ' ' << a[i] << ' ';
    }
    cout << '\n';
  }
  return 0;
}
