#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, s, f, t, l, r, dir, curStep = 1, ctr = 0;
  char arr[30];
  arr[5 + 1] = 'R', arr[5 - 1] = 'L';
  cin >> n >> m >> s >> f;
  if (f > s)
    dir = 1;
  else
    dir = -1;
  while (s != f) {
    if (ctr != m)
      cin >> t >> l >> r, ++ctr;
    else
      t = 1000000001;
    while (curStep != t && s != f) s = s + dir, cout << arr[5 + dir], ++curStep;
    if (s == f) break;
    if ((s >= l && s <= r) || s + dir == l || s + dir == r)
      cout << "X";
    else
      s = s + dir, cout << arr[5 + dir];
    ++curStep;
  }
  return 0;
}
