#include <bits/stdc++.h>
using namespace std;
long long n, m, st, ed, tem, p, pt;
long long stp;
bool seeked;
string ch;
struct node {
  long long t, l, r;
} a[200000];
bool cmp(node aa, node bb) { return aa.t < bb.t; }
long long i;
int main() {
  cin >> n >> m >> st >> ed;
  if (st > ed) {
    ch = "L";
    stp = -1;
  } else {
    ch = "R";
    stp = 1;
  }
  if (st == ed) {
    return 0;
  }
  for (i = 0; i < m; i++) {
    cin >> a[i].t >> a[i].l >> a[i].r;
  }
  tem = st;
  p = 0;
  pt = 1;
  while (tem != ed) {
    seeked = false;
    while (a[p].t <= pt && p <= m) {
      if ((a[p].l <= tem && a[p].r >= tem) ||
          (a[p].l <= tem + stp && a[p].r >= tem + stp))
        seeked = true;
      p++;
    }
    pt++;
    if (seeked) {
      cout << "X";
    } else {
      cout << ch;
      tem += stp;
    }
  }
  return 0;
}
