#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int arr[102];
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> arr[i];
    int myseq[102];
    for (int i = 1; i <= n; i++) {
      if (i & 1)
        myseq[i] = arr[i + 1];
      else
        myseq[i] = -arr[i - 1];
    }
    for (int i = 1; i <= n; i++) cout << myseq[i] << " ";
    cout << endl;
  }
  return 0;
}
