#include <bits/stdc++.h>
using namespace std;
vector<bool> prime(1001, true);
void sieve() {
  prime[0] = false;
  prime[1] = false;
  for (int i = 2; i <= 1000; i++) {
    if (prime[i]) {
      int j = 2;
      while (i * j <= 1000) {
        prime[i * j] = false;
        j++;
      }
    }
  }
}
long long int ceil_sqrt(long long int a) {
  long long int i = 1;
  while (i * i < a) i++;
  return i;
}
void solve() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i += 2) cout << a[i + 1] << " " << -1 * a[i] << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
