#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll mod(const ll x, const ll m) { return x % m >= 0 ? x % m : x % m + m; }
ll fld(const ll x, const ll y) { return (x - mod(x, y)) / y; }
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  ll t;
  cin >> n >> m >> t;
  auto initial_positions = vector<ll>();
  auto final_positions = vector<ll>();
  auto crosses = 0LL;
  for (auto i = 0; i < n; i++) {
    int s;
    char d;
    cin >> s >> d;
    s--;
    initial_positions.push_back(s);
    const auto delta = d == 'R' ? t : -t;
    final_positions.push_back(mod(s + delta, m));
    crosses += fld(s + delta, m);
    crosses = mod(crosses, n);
  }
  auto order = vector<int>(n);
  iota(begin(order), end(order), 0);
  sort(begin(order), end(order), [&](const int i, const int j) {
    return initial_positions[i] < initial_positions[j];
  });
  sort(begin(final_positions), end(final_positions));
  rotate(begin(final_positions), begin(final_positions) + crosses,
         end(final_positions));
  auto answers = vector<ll>(n);
  for (auto i = 0; i < n; i++) answers[order[i]] = final_positions[i];
  for (const auto x : answers) cout << x + 1 << " ";
  cout << endl;
}
