#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  int t = 1, x = s;
  int dir = (x < f) ? 1 : -1;
  while (m-- > 0) {
    int t_in, l, r;
    cin >> t_in >> l >> r;
    for (; t <= t_in; t++) {
      if (t != t_in || !(l <= x && x <= r) && !(l <= x + dir && x + dir <= r)) {
        cout << (dir == -1 ? "L" : "R");
        x += dir;
      } else
        cout << "X";
      if (x == f) return 0;
    }
  }
  for (; x != f; x += dir) cout << (dir == -1 ? "L" : "R");
  return 0;
}
