#include <bits/stdc++.h>
using namespace std;
long long callme(long long arr[], int k, int n) {
  long long ans = INT_MAX;
  for (int i = 0; i < n - k; i++) {
    ans = min(ans, arr[i + k - 1] - arr[i]);
  }
  return ans;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long arr[n];
    for (int i = 0; i < n; i++) cin >> arr[i];
    for (int i = 0; i < n; i += 2) cout << arr[i + 1] << " " << -arr[i] << " ";
    cout << endl;
  }
  return 0;
}
