#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ii = pair<ll, ll>;
using vi = vector<ll>;
using vb = vector<bool>;
using vvi = vector<vi>;
using vii = vector<ii>;
using vvii = vector<vii>;
const int INF = 2000000000;
const ll LLINF = 9000000000000000000;
void fix_mod(ll &v, ll M) { v = ((v - 1) % M + M) % M + 1; }
int main() {
  int N;
  ll M;
  ll T;
  cin >> N >> M >> T;
  vii Si(N, {0LL, 0LL});
  vi pos(N, 0LL);
  ll shift = 0;
  for (int i = 0; i < N; i++) {
    ll x;
    char c;
    cin >> x >> c;
    ll slope = (c == 'L' ? -1 : 1);
    ll ic = (slope == 1 ? 1 - x : x);
    shift += ((T / M) % N) * slope;
    fix_mod(ic, M);
    if (ic <= T % M) shift += slope;
    Si[i] = {x, i};
    pos[i] = x + (T % M) * slope;
    fix_mod(pos[i], M);
  }
  sort(Si.begin(), Si.end());
  sort(pos.begin(), pos.end());
  fix_mod(shift, N);
  vi ans(N, 0LL);
  for (int i = 0; i < N; i++) ans[Si[i].second] = pos[(i + shift) % N];
  for (int i = 0; i < N - 1; i++) cout << ans[i] << " ";
  cout << ans[N - 1] << endl;
}
