#include <bits/stdc++.h>
using namespace std;
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long INF = 1e18;
const long double pi = acos(-1);
const long long MAXN = 3e5 + 123;
long long n, m, t, pos[MAXN], epos[MAXN], ans[MAXN];
char d[MAXN];
long long sh;
pair<long long, long long> p[MAXN];
int main() {
  faster();
  cin >> n >> m >> t;
  for (int i = 1; i <= n; ++i) {
    cin >> pos[i] >> d[i];
    pos[i]--;
    p[i] = {pos[i], i};
  }
  sort(p + 1, p + n + 1);
  for (int i = 1; i <= n; ++i) {
    if (d[i] == 'L') {
      epos[i] = (((pos[i] - t) % m) + m) % m;
      sh = ((sh + ((pos[i] - t - epos[i]) / m)) % n + n) % n;
    } else {
      epos[i] = (pos[i] + t) % m;
      sh = ((sh + ((pos[i] + t - epos[i]) / m)) % n + n) % n;
    }
  }
  sort(epos + 1, epos + n + 1);
  for (int i = 1; i <= n; ++i) {
    ans[p[i].second] = epos[(i - 1 + sh) % n + 1] + 1;
  }
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << ' ';
  }
  cout << '\n';
  return 0;
}
