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