#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    long long arr[x], anss[x];
    for (int j = 0; j < x; j++) {
      cin >> arr[j];
    }
    for (int j = 0; j < x; j++) {
      if (arr[j] < 0 && arr[j + 1] > 0) {
        anss[j] = arr[j + 1];
        anss[j + 1] = arr[j] * -1;
      } else if (arr[j] > 0 && arr[j + 1] < 0) {
        anss[j] = arr[j + 1] * -1;
        anss[j + 1] = arr[j];
      } else {
        anss[j] = arr[j + 1];
        anss[j + 1] = arr[j] * -1;
      }
      j++;
    }
    for (int j = 0; j < x; j++) {
      cout << anss[j] << ' ';
      if (j == x - 1) cout << endl;
    }
  }
  return 0;
}
