#include <bits/stdc++.h>
using namespace std;
int nei(int now, int s, int f) {
  if (s < f)
    return now + 1;
  else
    return now - 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  int now = s;
  int t_now = 1;
  for (int i = 0; i < m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    while (t > t_now) {
      if (now == f) {
        cout << '\n';
        exit(0);
      } else {
        if (s < f)
          cout << 'R', now++;
        else
          cout << 'L', now--;
      }
      t_now++;
    }
    if (now == f) {
      cout << '\n';
      exit(0);
    }
    if ((now < l || now > r) && (nei(now, s, f) < l || nei(now, s, f) > r)) {
      if (s < f)
        cout << 'R', now++;
      else
        cout << 'L', now--;
    } else
      cout << 'X';
    t_now++;
  }
  while (now < f) cout << 'R', now++;
  while (now > f) cout << 'L', now--;
  cout << '\n';
  return 0;
}
