#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
using namespace std;
inline long long in() {
  long long x;
  scanf("%lld", &x);
  return x;
}
int32_t main() {
  long long n = in();
  long long m = in();
  long long s = in();
  long long f = in();
  long long cur = s;
  long long to = 0;
  for (long long i = 1; i <= m; i++) {
    long long t = in();
    long long l = in();
    long long r = in();
    if (t - to > 1) {
      if (cur < f) {
        long long d = min(t - to - 1, f - cur);
        cur += d;
        for (long long i = 1; i <= d; i++) cout << "R";
      } else if (cur > f) {
        long long d = min(t - to - 1, cur - f);
        cur -= d;
        for (long long i = 1; i <= d; i++) cout << "L";
      }
    }
    if (cur < f) {
      long long tar = cur + 1;
      if ((tar >= l and tar <= r) or (cur >= l and cur <= r))
        cout << "X";
      else {
        cout << "R";
        cur++;
      }
    } else if (cur > f) {
      long long tar = cur - 1;
      if ((tar >= l and tar <= r) or (cur >= l and cur <= r))
        cout << "X";
      else {
        cout << "L";
        cur--;
      }
    }
    to = t;
  }
  if (cur != f) {
    if (cur < f)
      cout << string(f - cur, 'R');
    else
      cout << string(cur - f, 'L');
  }
}
