#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const long long inff = 0x3f3f3f3f3f3f3f3f;
long long n, m, t, ans[300008], x, qw = 0, d[300008];
pair<int, int> a[300008];
char q;
int main() {
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> t;
  for (int i(0); i <= (n - 1); ++i) {
    scanf("%lld %c", &x, &q);
    x--;
    a[i].first = x;
    a[i].second = i;
    if (q == 'R') {
      ans[i] = (x + t) % m;
      qw += (x + t) / m;
    } else {
      ans[i] = (((x - t) % m) + m) % m;
      qw += (x - t) / m;
      if ((x - t) % m < 0) qw--;
    }
  }
  qw = ((qw % n) + n) % n;
  sort(a, a + n);
  sort(ans, ans + n);
  int zz = 0;
  for (int i(qw); i <= (n - 1); ++i) d[a[zz++].second] = ans[i] + 1;
  for (int i(0); i <= (qw - 1); ++i) d[a[zz++].second] = ans[i] + 1;
  for (int i(0); i <= (n - 1); ++i) printf("%d ", d[i]);
  puts("");
  return 0;
}
