#include <bits/stdc++.h>
#pragma GCC optimize "trapv"
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n];
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    }
    long long int neg = 0, pos = 0;
    if (a[1] - a[0] <= 0)
      neg = 1;
    else
      pos = 1;
    for (long long int i = 1; i < n - 1; i++) {
      if (neg == 1) {
        if (a[i + 1] - a[i] >= 0) {
          pos = 1;
          neg = 0;
        } else {
          if (abs(a[i + 1]) > abs(a[i]))
            a[i + 1] = -a[i + 1];
          else
            a[i] = -a[i];
          pos = 1;
          neg = 0;
        }
      } else {
        if (a[i + 1] - a[i] <= 0) {
          pos = 0;
          neg = 1;
        } else {
          if (abs(a[i + 1]) > abs(a[i]))
            a[i + 1] = -a[i + 1];
          else
            a[i] = -a[i];
          pos = 0;
          neg = 1;
        }
      }
    }
    for (long long int i = 0; i < n; i++) cout << a[i] << " ";
    cout << '\n';
  }
}
