#include <bits/stdc++.h>
using namespace std;
const long long N = 128;
long long a[N], b[N];
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long q;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    for (long long i = 1; i < n; i += 2) {
      b[i] = -a[i - 1];
      b[i - 1] = a[i];
    }
    for (long long i = 0; i < n; i++) cout << b[i] << ' ';
    cout << '\n';
  }
}
