#include <bits/stdc++.h>
using namespace std;
long long n, m, t;
long long s[311111];
long long S[311111];
bool d[311111];
long long I[311111];
long long J[311111];
long long ans[311111];
bool compI(long long i, long long j) { return s[i] < s[j]; }
bool compJ(long long i, long long j) { return S[i] < S[j]; }
long long get(long long idx, long long t) {
  long long jdx = -1;
  for (long long ii = 0; ii < (long long)(n); ii++) {
    if (I[ii] == idx) jdx = ii;
  }
  queue<long long> l, r;
  for (long long ii = jdx - 1; ii >= 0; ii--) {
    long long i = I[ii];
    if (d[i]) {
      if (s[idx] > s[i])
        l.push(s[idx] - s[i]);
      else
        l.push(m - (s[i] - s[idx]));
    }
  }
  for (long long ii = n - 1; ii >= jdx + 1; ii--) {
    long long i = I[ii];
    if (d[i]) {
      if (s[idx] > s[i])
        l.push(s[idx] - s[i]);
      else
        l.push(m - (s[i] - s[idx]));
    }
  }
  for (long long ii = jdx + 1; ii < n; ii++) {
    long long i = I[ii];
    if (!d[i]) {
      if (s[idx] < s[i])
        r.push(s[i] - s[idx]);
      else
        r.push(m - (s[idx] - s[i]));
    }
  }
  for (long long ii = 0; ii <= jdx - 1; ii++) {
    long long i = I[ii];
    if (!d[i]) {
      if (s[idx] < s[i])
        r.push(s[i] - s[idx]);
      else
        r.push(m - (s[idx] - s[i]));
    }
  }
  long long pos = s[idx];
  bool c = d[idx];
  long long tl = 0;
  long long tr = 0;
  while (t) {
    if (c) {
      long long dt = r.front() - tr;
      r.pop();
      l.push(m + tl);
      dt /= 2;
      if (t <= dt) {
        pos += t;
        pos %= m;
        t = 0;
        break;
      }
      pos += dt;
      pos %= m;
      t -= dt;
      tr += 2 * dt;
    } else {
      long long dt = l.front() - tl;
      l.pop();
      r.push(m + tr);
      dt /= 2;
      if (t <= dt) {
        pos -= t;
        pos += m;
        pos %= m;
        t = 0;
        break;
      }
      pos -= dt;
      pos += m;
      pos %= m;
      t -= dt;
      tl += 2 * dt;
    }
    c = !c;
  }
  return pos;
}
int main(void) {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cin >> n >> m >> t;
  m *= 2;
  t *= 2;
  for (long long i = 0; i < (long long)(n); i++) {
    char D;
    cin >> s[i] >> D;
    d[i] = (D == 'R');
    s[i]--;
    s[i] *= 2;
    I[i] = i;
  }
  sort(I, I + n, compI);
  long long pos1 = get(I[0], m);
  long long idx = -1;
  for (long long i = 0; i < (long long)(n); i++) {
    if (s[I[i]] == pos1) idx = i;
  }
  idx = (idx * (t / m)) % n;
  t %= m;
  for (long long i = 0; i < (long long)(n); i++) {
    S[i] = (s[i] + (d[i] ? 1 : -1) * t + m * m) % m;
    J[i] = i;
  }
  sort(J, J + n, compJ);
  long long pos2 = get(I[idx], t);
  long long pos3 = get(I[(idx + 1) % n], t);
  for (long long i = 0; i < (long long)(n); i++) {
    if (S[J[i]] == pos2 && S[J[(i + 1) % n]] == pos3) {
      idx = i;
      break;
    }
  }
  for (long long i = 0; i < (long long)(n); i++) {
    ans[I[i]] = S[J[idx]] / 2 + 1;
    idx++;
    idx %= n;
  }
  for (long long i = 0; i < (long long)(n); i++) {
    cout << ans[i] << " ";
  }
  cout << '\n';
  return 0;
}
