#include <bits/stdc++.h>
using namespace std;
const int M = 1000000000 + 7;
const double eps = 1e-10;
struct node {
  int t, l, r;
} num[100005];
int cmp(node a, node b) { return a.t < b.t; }
char ans[1000005];
int main() {
  int n, m, s, f;
  while (~scanf("%d %d %d %d", &n, &m, &s, &f)) {
    for (int i = 1; i <= m; i++)
      scanf("%d %d %d", &num[i].t, &num[i].l, &num[i].r);
    int time = 0;
    int now = s;
    int in = 1;
    sort(num + 1, num + m + 1, cmp);
    while (now != f && in <= m) {
      int tmp = num[in].t - time;
      while (tmp > 1) {
        if (now < f)
          ans[time++] = 'R', now++;
        else if (now > f)
          ans[time++] = 'L', now--;
        else
          break;
        tmp--;
      }
      if (now == f) break;
      if (now < f) {
        if ((num[in].l > now || num[in].r < now) &&
            (num[in].l > now + 1 || num[in].r < now + 1)) {
          ans[time++] = 'R';
          now++;
        } else
          ans[time++] = 'X';
      } else {
        if ((num[in].l > now || num[in].r < now) &&
            (num[in].l > now - 1 || num[in].r < now - 1)) {
          ans[time++] = 'L';
          now--;
        } else
          ans[time++] = 'X';
      }
      in++;
    }
    while (now != f) {
      if (now < f)
        ans[time++] = 'R', now++;
      else if (now > f)
        ans[time++] = 'L', now--;
    }
    ans[time] = '\0';
    printf("%s\n", ans);
  }
  return 0;
}
