#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  cin >> t;
  int A[101];
  while (t--) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> A[i];
    }
    for (int i = 0; i < n; i += 2) {
      cout << -A[i + 1] << " " << A[i] << " ";
    }
    cout << '\n';
  }
  return 0;
}
