#include <bits/stdc++.h>
using namespace std;
template <class T>
bool checkMin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool checkMax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1e9;
const int MN = -1;
const int N = 100000;
int n, m, s, f;
int t[N], l[N], r[N];
int main() {
  while (scanf("%d%d%d%d", &n, &m, &s, &f) != EOF) {
    for (int i = 0; i < m; i++) scanf("%d%d%d", t + i, l + i, r + i);
    int d = f - s < 0 ? -1 : 1;
    char print = (d < 0 ? 'L' : 'R');
    int time = 1, i = 0;
    while (s != f) {
      if (i < m && t[i] == time &&
          (l[i] <= s && s <= r[i] || l[i] <= s + d && s + d <= r[i])) {
        putchar('X');
      } else {
        putchar(print);
        s += d;
      }
      if (t[i] == time) i++;
      time++;
    }
    puts("");
  }
  return 0;
}
