#include <bits/stdc++.h>
using namespace std;
bool isPerfectSquare(long long int n) {
  long long int lol = sqrt(n);
  if (lol * lol == n)
    return true;
  else
    return false;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6) {
    if (n % i == 0 || n % (i + 2) == 0) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    for (long long int i = 0; i < (n / 2); i++) {
      long long int x, y;
      cin >> x >> y;
      cout << -y << ' ' << x << ' ';
    }
    cout << '\n';
  }
  return 0;
}
