#include <bits/stdc++.h>
using namespace std;
int main() {
  string u, str = "";
  int n, m, s, f, a, p = 0;
  cin >> n >> m >> s >> f;
  if (s < f) {
    u = "R";
    a = 1;
  } else {
    u = "L";
    a = -1;
  }
  for (int i = 0; i < m; i++) {
    int t, l, r;
    cin >> t >> l >> r;
    while (t - p > 0)
      if (s != f) {
        if (((s < l || r < s) && (s + a < l || r < s + a)) || p + 1 < t) {
          str += u;
          s += a;
        } else
          str += "X";
        p++;
      } else
        p = t;
  }
  if (s != f)
    for (int i = 0; i < a * (f - s); i++) str += u;
  cout << str;
}
