#include <bits/stdc++.h>
using namespace std;
int n, m;
long long t;
int s[300005];
char d[300005];
pair<int, int> o[300005];
int res[300005];
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]);
}
