#include <bits/stdc++.h>
using namespace std;
const int maxn = 200200;
long long a[maxn], mod[maxn], res[maxn];
vector<pair<long long, int> > ans;
priority_queue<pair<long long, int> > Q;
int n, k;
long long x;
bool canodd() {
  int idx = -1;
  long long mx = 1010101010;
  for (int i = 1; i <= n; i++)
    if (abs(a[i]) < mx) mx = abs(a[i]), idx = i;
  long long num = abs(a[idx] / x) + 1;
  if (num > k) return false;
  k -= num;
  if (a[idx] < 0)
    a[idx] = a[idx] + num * x;
  else
    a[idx] = a[idx] - num * x;
  return true;
}
int main() {
  while (cin >> n >> k >> x) {
    int cnt0 = 0, cnt1 = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      mod[i] = (a[i] % x + x) % x;
      if (a[i] == 0)
        cnt0++;
      else if (a[i] < 0)
        cnt1++;
    }
    ans.clear();
    if (cnt0 > k) {
      for (int i = 1; i <= n; i++) ans.push_back(make_pair(a[i], i));
    } else if (cnt1 & 1) {
      for (int i = 1; i <= n; i++)
        if (a[i] == 0) a[i] = x;
      k -= cnt0;
      for (int i = 1; i <= n; i++) Q.push(make_pair(-abs(a[i]), i));
      while (k-- && !Q.empty()) {
        long long u = -Q.top().first, tmp;
        int idx = Q.top().second;
        Q.pop();
        if (a[idx] < 0)
          tmp = -u - x;
        else
          tmp = u + x;
        Q.push(make_pair(-abs(tmp), idx));
      }
      while (!Q.empty()) {
        long long u = -Q.top().first;
        int idx = Q.top().second;
        if (a[idx] < 0) u *= -1;
        ans.push_back(make_pair(u, idx));
        Q.pop();
      }
    } else if (canodd()) {
      for (int i = 1; i <= n; i++) Q.push(make_pair(-abs(a[i]), i));
      while (k-- && !Q.empty()) {
        long long u = -Q.top().first, tmp;
        int idx = Q.top().second;
        Q.pop();
        if (a[idx] < 0)
          tmp = -u - x;
        else
          tmp = u + x;
        Q.push(make_pair(-abs(tmp), idx));
      }
      while (!Q.empty()) {
        long long u = -Q.top().first;
        int idx = Q.top().second;
        if (a[idx] < 0) u *= -1;
        ans.push_back(make_pair(u, idx));
        Q.pop();
      }
    } else {
      bool ok = 0;
      for (int i = 1; i <= n; i++)
        if (a[i] % x == 0) {
          if (abs(a[i] / x) <= k) {
            a[i] = 0, ok = 1;
            break;
          }
        }
      if (ok) {
        for (int i = 1; i <= n; i++) ans.push_back(make_pair(a[i], i));
      } else {
        for (int i = 1; i <= n; i++) Q.push(make_pair(-abs(a[i]), i));
        while (k-- && !Q.empty()) {
          long long u = -Q.top().first, tmp;
          int idx = Q.top().second;
          Q.pop();
          if (a[idx] < 0)
            tmp = -u + x;
          else
            tmp = u - x;
          Q.push(make_pair(-abs(tmp), idx));
        }
        while (!Q.empty()) {
          long long u = -Q.top().first;
          int idx = Q.top().second;
          if (a[idx] < 0) u *= -1;
          ans.push_back(make_pair(u, idx));
          Q.pop();
        }
      }
    }
    int sz = ans.size();
    if (sz > n)
      while (1)
        ;
    for (int i = 0; i < sz; i++) res[ans[i].second] = ans[i].first;
    for (int i = 1; i <= n; i++) printf("%I64d ", res[i]);
    puts("");
  }
  return 0;
}
