#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265359;
int n, m, s, f;
int main() {
  cin >> n >> m >> s >> f;
  for (int i = 0, j = 1; i < m; ++i) {
    int t, l, r;
    scanf("%d %d %d", &t, &l, &r);
    for (; j != t; ++j) {
      if (f < s)
        --s, putchar('L');
      else if (f > s)
        ++s, putchar('R');
      else
        return 0;
    }
    if (s == f) return 0;
    if (s >= l && s <= r)
      putchar('X');
    else if (f < s) {
      if (s - 1 >= l && s - 1 <= r)
        putchar('X');
      else
        --s, putchar('L');
    } else {
      if (s + 1 >= l && s + 1 <= r)
        putchar('X');
      else
        ++s, putchar('R');
    }
    ++j;
  }
  while (s != f)
    if (s < f)
      ++s, putchar('R');
    else
      --s, putchar('L');
  return 0;
}
