#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f, oo = inf;
inline long long read() {
  register long long x = 0;
  char f = 0;
  register char c = getchar();
  for (; !isdigit(c); c = getchar()) f |= (c == '-');
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return f ? -x : x;
}
inline double readdb() {
  register double x = 0, p = 0.1;
  register char f = 0, c = getchar();
  for (; !isdigit(c); c = getchar()) f |= (c == '-');
  for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
  if (c == '.')
    for (c = getchar(); isdigit(c); c = getchar(), p /= 10)
      x = x + (c ^ 48) * p;
  return f ? -x : x;
}
inline void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
inline void writeln(long long x) {
  write(x);
  puts("");
}
inline void writeln(long long x, char c, long long y) {
  write(x);
  putchar(c);
  writeln(y);
}
inline void writeln(long long x, char c, long long y, char d, long long z) {
  write(x);
  putchar(c);
  write(y);
  putchar(d);
  writeln(z);
}
const int maxn = 300055;
int n, m;
long long t;
int s[maxn];
char d[maxn];
pair<int, int> o[maxn];
int res[maxn];
int main() {
  scanf("%d%d%lld", &n, &m, &t);
  for (int i = (0); i < (n); i++) scanf("%d %c", s + i, d + i), s[i]--;
  for (int i = (0); i < (n); i++) o[i] = make_pair(s[i], i);
  sort(o, o + n);
  vector<long long> p;
  long long nc = 0;
  for (int i = (0); i < (n); i++) {
    int dir = d[i] == 'L' ? -1 : 1;
    long long pos = s[i] + dir * t;
    long long fp = ((pos % m) + m) % m;
    long long g = pos > 0 ? pos / m : (pos - m + 1) / m;
    nc += g;
    p.push_back(fp);
  }
  nc = ((nc % n) + n) % n;
  sort(p.begin(), p.end());
  for (int i = (0); i < (n); i++) res[o[i].second] = p[(i + nc) % n];
  for (int i = (0); i < (n); i++) printf("%d%c", res[i] + 1, " \n"[i + 1 == n]);
}
