#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000001;
const long long int LLINF = 1000000000000000001LL;
struct ant {
  long long int pos;
  int id, dir;
};
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  long long int m, t;
  cin >> n >> m >> t;
  vector<ant> ants;
  for (int i = (0); i <= (n - 1); ++i) {
    int s;
    char d;
    cin >> s >> d;
    ants.push_back({s, i, (d == 'R' ? 1 : -1)});
  }
  sort(ants.begin(), ants.end(),
       [](const ant &a, const ant &b) { return a.pos < b.pos; });
  vector<long long int> endConfig;
  for (auto &a : ants) {
    long long int newPos = a.pos + (t % m) * a.dir;
    newPos %= m;
    if (newPos < 0) newPos += m;
    endConfig.push_back(newPos);
  }
  sort(endConfig.begin(), endConfig.end());
  long long int total = 0;
  for (auto &a : ants) {
    total += (t % (n * m)) * a.dir;
    total %= (n * m);
  }
  if (total < 0) total += (n * m);
  total /= m;
  long long int totalInit = 0;
  for (int i = (0); i <= (n - 1); ++i) {
    long long int diff = endConfig[i] - ants[i].pos;
    totalInit += diff;
    totalInit %= (n * m);
  }
  if (totalInit < 0) totalInit += (n * m);
  totalInit /= m;
  long long int rotateBy = totalInit - total;
  vector<int> ans(n);
  for (int i = (0); i <= (n - 1); ++i) {
    int j = (i - rotateBy + n) % n;
    ans[ants[i].id] = endConfig[j];
  }
  for (int i = (0); i <= (n - 1); ++i)
    if (ans[i] == 0) {
      ans[i] = m;
    }
  for (int i = (0); i <= (n - 1); ++i) cout << ans[i] << ' ';
  return 0;
}
