#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int l[maxn], r[maxn], t[maxn], n, m, b, e, f[maxn], pt, pp;
int tt, dis;
inline bool underspy(int s) { return ((s >= l[pt]) && (s <= r[pt])); }
int main() {
  scanf("%d%d%d%d", &n, &m, &b, &e);
  memset(f, -1, n);
  for (int i = 0; i < m; i++) scanf("%d%d%d", t + i, l + i, r + i);
  pt = 0;
  if (e == b) {
    printf("0\n");
    return 0;
  }
  if (e < b)
    dis = -1;
  else
    dis = 1;
  pp = b;
  f[pp] = 0;
  tt = 0;
  while (pp != e) {
    tt++;
    if (tt == t[pt]) {
      if (!(underspy(pp) || underspy(pp + dis))) {
        printf("%c", (dis == -1) ? 'L' : 'R');
        f[pp + dis] = tt;
        pp += dis;
      } else {
        printf("X");
        f[pp]++;
      }
      pt++;
    } else {
      printf("%c", (dis == -1) ? 'L' : 'R');
      f[pp + dis] = tt;
      pp += dis;
    }
  }
  printf("\n");
  return 0;
}
