#include <bits/stdc++.h>
using namespace std;
struct c_istream {
  c_istream operator>>(int &n) {
    scanf("%i", &n);
    return *this;
  }
  c_istream operator>>(char &c) {
    scanf("%c", &c);
    return *this;
  }
  c_istream operator>>(double &d) {
    scanf("%lf", &d);
    return *this;
  }
};
struct c_ostream {
  c_ostream operator<<(int n) {
    printf("%d", n);
    return *this;
  }
  c_ostream operator<<(char c) {
    printf("%c", c);
    return *this;
  }
  c_ostream operator<<(double d) {
    printf("%lf", d);
    return *this;
  }
  c_ostream operator<<(const char *s) {
    printf("%s", s);
    return *this;
  }
};
int nums[100000];
int main() {
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  bool right = false;
  if (f > s) right = true;
  int t = 1;
  int ct, cl, cr;
  while (m > 0) {
    cin >> ct >> cl >> cr;
    m--;
    while (t < ct) {
      if (s == f) return 0;
      if (right) {
        cout << "R";
        s++;
      } else {
        cout << "L";
        s--;
      }
      t++;
    }
    if (s == f) return 0;
    if (right && (s + 1 > cr || s + 1 < cl) && (s > cr || s < cl)) {
      cout << "R";
      s++;
    } else if (!right && (s - 1 > cr || s - 1 < cl) && (s > cr || s < cl)) {
      cout << "L";
      s--;
    } else
      cout << "X";
    t++;
  }
  while (s != f) {
    if (right) {
      cout << "R";
      s++;
    } else {
      cout << "L";
      s--;
    }
  }
  return 0;
}
