#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void check_min(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void check_max(T &a, T b) {
  if (a < b) a = b;
}
const int MAX_N = 3e5 + 5;
inline int madd(int a, long long b, int m) {
  a = (a + b) % m;
  if (a < 0) a += m;
  return a;
}
int n, m;
long long t;
vector<tuple<int, int, int>> ps;
int func(int id, int tt) {
  int pos = get<0>(ps[id]) * 2, d = get<1>(ps[id]);
  queue<int> a, b;
  for (int i = 0; i < int(n - 1); ++i) {
    int j = (id + 1 + i) % n;
    if (get<1>(ps[j]) == 0) b.push(get<0>(ps[j]) * 2);
  }
  for (int i = 0; i < int(n - 1); ++i) {
    int j = (n + id - 1 - i) % n;
    if (get<1>(ps[j]) == 1) a.push(get<0>(ps[j]) * 2);
  }
  int mm = 2 * m;
  for (int t = 0; t < tt * 2;) {
    queue<int> *p = &a, *q = &b;
    if (d == 1) swap(p, q);
    int po = madd(pos, d ? t : -t, mm);
    int pp = madd(p->front(), d == 0 ? t : -t, mm);
    int dt = ((d == 0 ? po - pp : pp - po) + mm) % mm;
    if (dt == 0) dt = mm;
    dt /= 2;
    if (dt > 2 * tt - t) break;
    q->push(pos);
    pos = p->front(), d ^= 1;
    p->pop();
    t += dt;
  }
  int x = madd(pos, d ? 2 * tt : -2 * tt, mm) / 2;
  return x;
}
int gao(int id) {
  int x = func(id, m);
  for (int i = 0; i < int(n); ++i) {
    if (get<0>(ps[i]) == x) {
      int di = (n + i - id) % n;
      return func((id + (t / m) % n * di) % n, t - t / m * m);
    }
  }
  assert(false);
  return -1;
}
int main() {
  scanf("%d%d%lld", &n, &m, &t);
  ps.reserve(n);
  int s, d, ds[2] = {};
  for (int i = 0; i < int(n); ++i) {
    char dir[4];
    scanf("%d%s", &s, dir);
    d = dir[0] == 'R';
    ps.emplace_back(s - 1, d, i);
    ds[d] = 1;
  }
  if (ds[0] + ds[1] == 1) {
    for (int i = 0; i < int(n); ++i) {
      tie(s, d, ignore) = ps[i];
      printf("%d ", madd(s, d ? t : -t, m) + 1);
    }
  } else {
    sort((ps).begin(), (ps).end());
    int pos = gao(0);
    vector<int> v;
    v.reserve(2 * n);
    for (int i = 0; i < int(n); ++i) {
      tie(s, d, ignore) = ps[i];
      v.emplace_back(madd(s, d ? t : -t, m));
    }
    sort((v).begin(), (v).end());
    for (auto it = v.begin();; ++it) {
      if (*it == pos) {
        if (it != prev(v.end()) && *next(it) == pos) {
          int pos2 = gao(1);
          if (pos2 != pos) {
            v.push_back(*it++);
          }
        }
        v.erase(v.begin(), it);
        break;
      } else {
        v.push_back(*it);
      }
    }
    static int ans[MAX_N];
    for (int i = 0; i < int(n); ++i) {
      ans[get<2>(ps[i])] = v[i];
    }
    for (int i = 0; i < int(n); ++i) {
      printf("%d ", ans[i] + 1);
    }
  }
  printf("\n");
  return 0;
}
