#include <bits/stdc++.h>
using namespace std;
int i, j, k, l, x, y, z, m, n, ans, dir, s, f, current, p, q;
pair<int, int> a;
pair<int, pair<int, int> > spies[300000];
int main() {
  scanf("%d %d %d %d", &n, &m, &s, &f);
  for (i = 0; i < m; i++) {
    scanf("%d %d %d", &x, &y, &z);
    a = make_pair(y, z);
    spies[i] = make_pair(x, a);
  }
  if (s > f)
    dir = -1;
  else
    dir = 1;
  current = s;
  i = 0;
  j = 1;
  while (current != f) {
    a = spies[i].second;
    x = spies[i].first;
    if (x == j) {
      i++;
      y = a.first;
      z = a.second;
      p = current;
      q = current + dir;
      if ((p >= y && p <= z) || (q >= y && q <= z)) {
        printf("X");
      } else {
        current = current + dir;
        if (dir == 1)
          printf("R");
        else
          printf("L");
      }
    } else {
      current = current + dir;
      if (dir == 1)
        printf("R");
      else
        printf("L");
    }
    j++;
  }
  return 0;
}
