#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    int ar[n + 1];
    for (int i = 1; i <= n; i++) {
      cin >> ar[i];
    }
    for (int i = 1; i <= n; i += 2) {
      cout << ar[i + 1] << " " << -ar[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
