#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, n, num;
  cin >> T;
  vector<vector<int>> meme(T);
  for (int i = 0; i < T; i++) {
    cin >> n;
    int sign = 1;
    for (int j = 0; j < n; j++) {
      cin >> num;
      meme[i].push_back(sign * num);
      sign *= -1;
    }
  }
  for (int i = 0; i < T; i++) {
    int k = meme[i].size();
    for (int j = 0; j < k; j++) {
      cout << meme[i].back() << " ";
      meme[i].pop_back();
    }
    cout << endl;
  }
  return 0;
}
