#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  char pass = (s > f) ? 'L' : 'R';
  int t, l, r;
  int prev = 0;
  for (int i = 0; i < m; i++) {
    cin >> t >> l >> r;
    if (s == f) continue;
    int frees = t - prev - 1;
    for (int j = 0; j < frees; j++) {
      cout << pass;
      if (s < f)
        s++;
      else
        s--;
      if (s == f) {
        break;
      }
    }
    if (s != f) {
      if (s > f) {
        if (s - 1 > r || s < l) {
          s--;
          cout << pass;
        } else {
          cout << 'X';
        }
      } else {
        if (s > r || s + 1 < l) {
          s++;
          cout << pass;
        } else {
          cout << 'X';
        }
      }
    }
    prev = t;
  }
  int rem = f - s;
  if (rem < 0) rem *= -1;
  for (int i = 0; i < rem; i++) cout << pass;
  return 0;
}
