#include <bits/stdc++.h>
using namespace std;
int n, m;
long long t;
int s[310000];
char d[310000];
pair<int, int> pos[310000];
int ans[310000];
int main() {
  cin >> 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++) pos[i] = make_pair(s[i], i);
  sort(pos, pos + n);
  vector<long long> p;
  long long nc = 0;
  for (int i = 0; i < n; i++) {
    int op = d[i] == 'L' ? -1 : 1;
    long long pp = s[i] + op * t;
    long long ff = ((pp % m) + m) % m;
    long long g = pp > 0 ? pp / m : (pp - m + 1) / m;
    nc += g;
    p.push_back(ff);
  }
  nc = ((nc % n) + n) % n;
  sort(p.begin(), p.end());
  for (int i = 0; i < n; i++) ans[pos[i].second] = p[(i + nc) % n];
  for (int i = 0; i < n; i++) printf("%d ", ans[i] + 1);
  return 0;
}
