#include <bits/stdc++.h>
using namespace std;
struct line {
  int m, c;
  line(int M, int C) : m(M), c(C) {}
  int calc(int x) const { return m * x + c; }
};
struct ant {
  int s;
  int d;
  int id;
  line makeline() const {
    if (d == 0)
      return line(-1, s);
    else
      return line(1, s);
  }
  bool operator<(const ant& oth) const { return (s < oth.s); }
};
vector<line> l;
int ans[300005];
ant a[300005];
int shift;
int n, m;
long long t;
int fix(int loc) {
  if (loc <= 0) loc += m;
  if (loc <= 0) loc += m;
  if (loc <= 0) loc += m;
  if (loc > m) loc -= m;
  if (loc > m) loc -= m;
  if (loc > m) loc -= m;
  return loc;
}
int travel(int loc, int per) {
  vector<int> ycors;
  for (const line& u : l) ycors.push_back(u.calc(0));
  sort(ycors.begin(), ycors.end());
  int index = lower_bound(ycors.begin(), ycors.end(), loc) - ycors.begin();
  ycors.clear();
  for (const line& u : l) ycors.push_back(u.calc(per));
  sort(ycors.begin(), ycors.end());
  return fix(ycors[index]);
}
bool relevant(int val) { return (val >= -m && val <= m); }
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> t;
  for (int i = 0; i < n; i++) {
    char tmp;
    cin >> a[i].s >> tmp;
    a[i].d = (tmp == 'R');
    a[i].id = i;
    line me = a[i].makeline();
    while (true) {
      me.c -= m;
      if (!relevant(me.calc(0)) && !relevant(me.calc(m))) break;
    }
    for (me.c += m; relevant(me.calc(0)) || relevant(me.calc(m)); me.c += m)
      l.push_back(me);
  }
  sort(a, a + n);
  int oloc = a[0].s;
  int nloc = travel(a[0].s, m);
  while (a[shift].s != nloc) shift++;
  long long numperiods = t / m;
  shift = (shift * numperiods) % n;
  t %= m;
  nloc = travel(a[shift].s, t);
  int nloc2 = travel(a[(shift + 1) % n].s, t);
  vector<int> ycors;
  for (int i = 0; i < n; i++) ycors.push_back(fix(a[i].makeline().calc(t)));
  sort(ycors.begin(), ycors.end());
  shift = 0;
  while (ycors[shift] != nloc || ycors[(shift + 1) % n] != nloc2) shift++;
  for (int i = 0; i < n; i++) ans[a[i].id] = ycors[(i + shift) % n];
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
