#include <bits/stdc++.h>
using namespace std;
pair<long long, long long> pos[300007], fin[300007];
long long ans[300007];
long long mult(long long a, long long b, long long mod) {
  a %= mod;
  b %= mod;
  if (a < 0) a += mod;
  if (b < 0) b += mod;
  long long now = (a * b) % mod;
  return now;
}
int main() {
  long long n, m, t, i, j, k, x, y;
  char ch;
  scanf("%lld%lld%lld", &n, &m, &t);
  long long mod = n * m;
  long long speed = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", &pos[i].first);
    pos[i].first--;
    pos[i].second = i;
    cin >> ch;
    long long dir = (ch == 'L') ? -1 : 1;
    speed = (ch == 'L') ? speed - t : speed + t;
    speed %= mod;
    fin[i].first = (pos[i].first + dir * t) % m;
    if (fin[i].first < 0) fin[i].first += m;
    fin[i].second = i;
  }
  speed %= mod;
  if (speed < 0) speed += mod;
  long long tot = speed;
  long long shift = 0;
  sort(pos, pos + n);
  sort(fin, fin + n);
  for (i = 0; i < n; i++) {
    tot += pos[i].first - fin[i].first;
  }
  tot %= mod;
  if (tot < 0) tot += mod;
  long long now = tot / m;
  for (i = 0; i < n; i++) {
    ans[pos[i].second] = fin[(i + now) % n].first;
  }
  for (i = 0; i < n; i++) {
    printf("%lld ", ans[i] + 1);
  }
  return 0;
}
