#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
pair<int, int> a[(int)1e5 + 100];
int n, m, s, g;
int main() {
  scanf("%d%d%d%d", &n, &m, &s, &g);
  int dx = (s > g) ? -1 : 1;
  memset(a, -1, sizeof(a));
  for (int i = 1; i <= int(m); i++) {
    int l, r, t;
    scanf("%d%d%d", &t, &l, &r);
    mp[t] = i;
    a[i] = pair<int, int>(l, r);
  }
  int T = 1;
  int p = s;
  while (true) {
    int t = mp[T];
    int l = a[t].first, r = a[t].second;
    if ((l <= p && p <= r) || (l <= p + dx && p + dx <= r))
      putchar('X');
    else {
      if (dx == 1)
        putchar('R');
      else
        putchar('L');
      p += dx;
      if (p == g) break;
    }
    T++;
  }
}
