#include <bits/stdc++.h>
const long long M = 1e9 + 7;
const long long N = 2e5 + 5;
using namespace std;
const double pi = 3.14159265358979323846264338327950;
const long long A = 1e9 + 1;
double esp = 1e-3;
vector<long long> square;
int main() {
  ios::sync_with_stdio(0);
  ;
  cin.tie(0);
  ;
  long long n, m, s, f;
  cin >> n >> m >> s >> f;
  long long x = s;
  string str;
  long long tt = 0;
  while (m--) {
    long long t, l, r;
    cin >> t >> l >> r;
    if (t - tt != 1) {
      if (x > f) {
        while (t - tt != 1 && x != f) {
          str.push_back('L');
          x--;
          tt++;
        }
      } else if (x < f) {
        while (t - tt != 1 && x != f) {
          str.push_back('R');
          x++;
          tt++;
        }
      } else
        break;
    }
    if (x == f) break;
    if (x < f) {
      if (x >= l && x <= r) {
        str.push_back('X');
      } else if (x + 1 >= l && x + 1 <= r) {
        str.push_back('X');
      } else {
        str.push_back('R');
        x++;
      }
    }
    if (x > f) {
      if (x >= l && x <= r) {
        str.push_back('X');
      } else if (x - 1 >= l && x - 1 <= r) {
        str.push_back('X');
      } else {
        str.push_back('L');
        x--;
      }
    }
    tt = t;
  }
  if (x < f) {
    while (x != f) {
      str.push_back('R');
      x++;
    }
  }
  if (x > f) {
    while (x != f) {
      str.push_back('L');
      x--;
    }
  }
  cout << str << endl;
}
