#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  int M;
  ll T;
  cin >> N >> M >> T;
  vector<vector<int>> ants(N, vector<int>(4, 0));
  int totalSpeed = 0;
  for (int i = 0; i < N; i++) {
    cin >> ants[i][0];
    ants[i][0] %= M;
    string dir;
    cin >> dir;
    ants[i][1] = (dir[0] == 'L' ? -1 : 1);
    ants[i][2] = i;
    totalSpeed += ants[i][1];
  }
  sort(ants.begin(), ants.end(),
       [](const vector<int>& a, const vector<int>& b) { return a[0] < b[0]; });
  vector<int> q(N);
  for (int i = 0; i < N; i++) {
    q[i] = (int)(ants[i][0] + (ants[i][1] * (T % M) % M)) % M;
    if (q[i] < 0) q[i] += M;
  }
  sort(q.begin(), q.end());
  ll NM = (ll)N * M;
  ll sT = 0;
  for (int j = 0; j < abs(totalSpeed); j++) {
    sT += T;
    sT %= NM;
  }
  if (totalSpeed < 0) sT = -sT;
  if (sT < 0) sT += NM;
  ll totalDisplace = 0;
  for (int j = 0; j < N; j++) {
    totalDisplace += q[j] - ants[j][0];
    totalDisplace %= NM;
  }
  int x = (int)((sT - totalDisplace) / M);
  if (x < 0) x += N;
  for (int i = 0; i < N; i++) {
    ants[i][3] = q[(i + x) % N];
    if (ants[i][3] == 0) ants[i][3] = M;
  }
  sort(ants.begin(), ants.end(),
       [](const vector<int>& a, const vector<int>& b) { return a[2] < b[2]; });
  for (int i = 0; i < N - 1; i++) cout << ants[i][3] << " ";
  cout << ants[N - 1][3] << endl;
}
