#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m, s, f;
  cin >> n >> m >> s >> f;
  long long int t[m], l[m], r[m];
  for (long long i = 0; i < m; i++) {
    cin >> t[i] >> l[i] >> r[i];
  }
  string str;
  long long int pos = s, step = 1, j = 0;
  if (s <= f) {
    for (int step = 1;; step++) {
      if (pos == f) break;
      if (t[j] == step) {
        if ((l[j] <= pos && r[j] >= pos) ||
            (l[j] <= pos + 1 && r[j] >= pos + 1)) {
          str.push_back('X');
        } else {
          str.push_back('R');
          pos++;
        }
        j++;
      } else {
        str.push_back('R');
        pos++;
      }
    }
  } else {
    for (int step = 1;; step++) {
      if (pos == f) break;
      if (t[j] == step) {
        if ((l[j] <= pos && r[j] >= pos) ||
            (l[j] <= pos - 1 && r[j] >= pos - 1)) {
          str.push_back('X');
        } else {
          str.push_back('L');
          pos--;
        }
        j++;
      } else {
        str.push_back('L');
        pos--;
      }
    }
  }
  cout << str;
  return 0;
}
