#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, f;
  scanf("%d%d%d%d", &n, &m, &s, &f);
  if (s < f) {
    int e = s, st = 1;
    string ss;
    while (m--) {
      int t, l, r;
      scanf("%d%d%d", &t, &l, &r);
      if (st < t)
        for (int i = st; i < t; i++)
          if (e < f) {
            ss += "R";
            e++;
          }
      st = t;
      st++;
      if (e >= l - 1 && e <= r && e < f)
        ss += "X";
      else if (e < f) {
        ss += "R";
        e++;
      }
    }
    if (e < f)
      for (int i = e; i < f; i++) ss += "R";
    cout << ss << endl;
  } else {
    int e = s, st = 1;
    string ss;
    while (m--) {
      int t, l, r;
      scanf("%d%d%d", &t, &l, &r);
      if (st < t)
        for (int i = st; i < t; i++)
          if (e > f) {
            ss += "L";
            e--;
          }
      st = t;
      st++;
      if (e >= l && e <= r + 1 && e > f)
        ss += "X";
      else if (e > f) {
        ss += "L";
        e--;
      }
    }
    if (e > f)
      for (int i = e; i > f; i--) ss += "L";
    cout << ss << endl;
  }
  return 0;
}
