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