#include <bits/stdc++.h>
using namespace std;
int NOD(int a, int b) {
  int div;
  if (a == b) return a;
  int d = a - b;
  if (d < 0) {
    d = -d;
    div = NOD(a, d);
  } else
    div = NOD(b, d);
  return div;
}
int NOK(int a, int b) { return a * b / NOD(a, b); }
int main() {
  int t;
  cin >> t;
  for (int w = 0; w < t; w++) {
    int n;
    cin >> n;
    map<int, int> a, b;
    for (int i = 0; i < n; i++) cin >> a[i];
    int i = 0;
    while (i < n) {
      if (i % 2 == 0) {
        b[i + 1] = a[i];
        b[i] = -1 * a[i + 1];
        i += 2;
      }
    }
    for (int i = 0; i < n; i++) cout << b[i] << ' ';
    cout << endl;
  }
}
