#include <bits/stdc++.h>
int N, d[300001], p[300001];
long long s[300001], e[300001], M, T, move, O[300001];
int main() {
  scanf("%d%lld%lld", &N, &M, &T);
  for (int i = 1, x; i <= N; i++) {
    scanf("%lld", s + i);
    do x = getchar();
    while (x != 'L' && x != 'R');
    d[i] = x == 'L' ? -1 : 1;
    e[i] = s[i] + d[i] * T;
    if (e[i] <= 0)
      move -= (M - e[i]) / M;
    else
      move += (e[i] - 1) / M;
    e[i] = (e[i] % M + M - 1) % M + 1;
    p[i] = i;
  }
  move = (move % N + N) % N;
  std::sort(e + 1, e + N + 1);
  std::sort(p + 1, p + N + 1, [](int x, int y) { return s[x] < s[y]; });
  for (int i = 1; i <= N; i++) O[p[i]] = e[(i + move - 1) % N + 1];
  for (int i = 1; i <= N; i++) printf("%lld%c", O[i], " \n"[i == N]);
  return 0;
}
