#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
int infinite = INT_MAX - 10;
template <typename T>
T power(T x, T y) {
  T temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else {
    if (y > 0)
      return x * temp * temp;
    else
      return (temp * temp) / x;
  }
}
int countDigit(long long n) { return floor(log10(n) + 1); }
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
class util {
 public:
  int t, l, r;
};
void solve() {
  int n, m, s, f;
  cin >> n >> m >> s >> f;
  int t, l, r;
  int step = 0, note = s;
  vector<util> arr(m);
  for (int i = 0; 0 < m ? i < m : i > m; 0 < m ? i += 1 : i -= 1) {
    cin >> arr[i].t >> arr[i].l >> arr[i].r;
  }
  int i = 0;
  while (true) {
    ++step;
    t = arr[i].t, l = arr[i].l, r = arr[i].r;
    if (note == f) break;
    if (step != t) {
      if (f > note)
        note++, cout << "R";
      else if (f < note)
        note--, cout << "L";
    } else {
      if (note >= l and note <= r)
        cout << "X";
      else if (f > note) {
        if (note + 1 >= l and note + 1 <= r)
          cout << "X";
        else
          note++, cout << "R";
      } else if (f < note) {
        if (note - 1 >= l and note - 1 <= r)
          cout << "X";
        else
          note--, cout << "L";
      }
      ++i;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
