#include <bits/stdc++.h>
using namespace std;
map<int, pair<int, int> > w;
int main() {
  int n, m, s, f, temp;
  cin >> n >> m >> s >> f;
  for (int i = 0; i < m; i++) {
    cin >> temp;
    cin >> w[temp].first >> w[temp].second;
  }
  int pasos = 1, pos = s;
  while (pos != f) {
    if (s < f) {
      while (w[pasos].first <= pos + 1 && w[pasos].second >= pos) {
        pasos++;
        cout << 'X';
      }
      cout << 'R';
      pos++;
    } else {
      while (w[pasos].first <= pos && w[pasos].second >= pos - 1) {
        pasos++;
        cout << 'X';
      }
      cout << 'L';
      pos--;
    }
    pasos++;
  }
  return 0;
}
