#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int n, m, L, R;
long long T;
long long g[300009];
int A[300009];
long long k[900009];
int c[900009], lb[900009], nx[900009], pr[900009], wR[900009], wL[900009];
struct node {
  int x, c, t;
} q[300009];
bool cmp(node a, node b) { return a.x < b.x; }
char que[3];
inline int Get() {
  scanf("%s", que);
  return que[0] == 'R' ? 1 : -1;
}
int main() {
  n = read(), m = read();
  scanf("%I64d", &T);
  for (int i = 1; i <= n; i++) q[i].x = read(), q[i].c = Get(), q[i].t = i;
  sort(q + 1, q + 1 + n, cmp);
  for (int i = 1; i <= n; i++) g[i] = i - 1;
  for (int i = 1; i <= n; i++)
    if (q[i].c > 0)
      R++;
    else
      L++;
  long long tmp = T / m;
  for (int i = 1; i <= n; i++)
    if (q[i].c > 0)
      g[i] = (g[i] + tmp * 2 * L) % n;
    else
      g[i] = ((g[i] - tmp * 2 * R) % n + n) % n;
  for (int i = 1; i <= n; i++)
    k[i] = k[i + n] = k[i + 2 * n] = q[i].x, k[i + n] += m,
    k[i + 2 * n] += m + m;
  for (int i = 1; i <= n; i++) c[i] = c[i + n] = c[i + 2 * n] = q[i].c;
  L = 0;
  for (int i = 1; i <= 3 * n; i++)
    if (c[i] < 0) lb[i] = ++L, wL[L] = i;
  R = 0;
  for (int i = 1; i <= 3 * n; i++)
    if (c[i] > 0) lb[i] = ++R, wR[R] = i;
  lb[3 * n + 1] = L + 1;
  for (int i = 1; i <= 3 * n; i++)
    pr[i] = (c[i - 1] == c[i] ? pr[i - 1] : lb[i - 1]);
  for (int i = 3 * n; i >= 1; i--)
    nx[i] = (c[i + 1] == c[i] ? nx[i + 1] : lb[i + 1]);
  tmp = T % m * 2;
  for (int i = 1; i <= n; i++)
    if (c[i] > 0) {
      int l = nx[i] - 1, r = L;
      while (l < r) {
        int mid = (l + r) >> 1;
        if (k[wL[mid + 1]] - k[i] <= tmp)
          l = mid + 1;
        else
          r = mid;
      }
      g[i] += l - nx[i] + 1;
    }
  for (int i = 2 * n + 1; i <= 3 * n; i++)
    if (c[i] < 0) {
      int l = 1, r = pr[i] + 1;
      while (l < r) {
        int mid = (l + r) >> 1;
        if (k[i] - k[wR[mid]] <= tmp)
          r = mid;
        else
          l = mid + 1;
      }
      g[(i - 1) % n + 1] -= pr[i] - l + 1;
    }
  for (int i = 1; i <= n; i++)
    ((g[i] %= n) += n) %= n, ((((k[i] += tmp / 2 * c[i]) %= m) += m) %= m);
  for (int i = 1; i <= n; i++) A[q[g[i] + 1].t] = k[i];
  for (int i = 1; i <= n; i++)
    printf("%d%c", A[i] == 0 ? m : A[i], i == n ? '\n' : ' ');
  return 0;
}
