#include <bits/stdc++.h>
using namespace std;
char ans[1000009];
int tot;
int main() {
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  int t[100009], l[100009], r[100009];
  for (int i = 1; i <= (m); i++) cin >> t[i] >> l[i] >> r[i];
  tot = 0;
  int p = 1;
  while (1) {
    ++tot;
    if (t[p] == tot) {
      if (s >= l[p] && s <= r[p])
        ans[tot] = 'X';
      else {
        if (f > s) {
          if (s + 1 >= l[p] && s + 1 <= r[p])
            ans[tot] = 'X';
          else
            ans[tot] = 'R', s++;
        } else {
          if (s - 1 >= l[p] && s - 1 <= r[p])
            ans[tot] = 'X';
          else
            ans[tot] = 'L', s--;
        }
      }
      p++;
    } else {
      if (f > s)
        ans[tot] = 'R', s++;
      else
        ans[tot] = 'L', s--;
    }
    if (s == f) break;
  }
  for (int i = 1; i <= (tot); i++) cout << ans[i];
}
