#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int n, m, s, f, t[maxn], l[maxn], r[maxn];
int main() {
  scanf("%d%d%d%d", &n, &m, &s, &f);
  for (int i = 1; i <= m; i++) scanf("%d%d%d", &t[i], &l[i], &r[i]);
  if (s < f) {
    for (int i = 1, j = 1; i < maxn << 1; i++) {
      if (s == f) break;
      if (j <= m && i == t[j]) {
        if ((l[j] <= s && s <= r[j]) || (l[j] <= s + 1 && s + 1 <= r[j]))
          printf("X");
        else {
          s++;
          printf("R");
        }
        j++;
      } else {
        s++;
        printf("R");
      }
    }
    printf("\n");
  } else {
    for (int i = 1, j = 1; i < maxn << 1; i++) {
      if (s == f) break;
      if (j <= m && i == t[j]) {
        if ((l[j] <= s && s <= r[j]) || (l[j] <= s - 1 && s - 1 <= r[j]))
          printf("X");
        else {
          s--;
          printf("L");
        }
        j++;
      } else {
        s--;
        printf("L");
      }
    }
    printf("\n");
  }
  return 0;
}
