#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int test = 0; test < t; test++) {
    int n, a[100];
    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 << endl;
  }
}
