#include <bits/stdc++.h>
using namespace std;
const int MAXN = 412345;
const int MAXINT = 2047483098;
const long long int MOD = 1e9 + 7;
const int MAX = 1e4;
const long double pi = 2 * acosl(0);
const long double EPS = 1e-10;
bool compo(pair<long long int, long long int> &a,
           pair<long long int, long long int> &b) {
  return a.first > b.first;
}
void solve() {
  long long int n, m, s, f;
  cin >> n >> m >> s >> f;
  long long int curr = s;
  vector<tuple<long long int, long long int, long long int> > v(m);
  long long int t, l, r;
  for (long long int i = 0; i < m; i++) {
    cin >> t >> l >> r;
    v[i] = make_tuple(t, l, r);
  }
  long long int exp = 1;
  if (f >= s) {
    for (auto x : v) {
      long long int a = get<0>(x);
      long long int b = get<1>(x);
      long long int c = get<2>(x);
      if (curr == f) break;
      if (a != exp) {
        while (a != exp && curr != f) {
          exp++;
          curr++;
          cout << 'R';
        }
      }
      if (a == exp && curr != f) {
        if (curr >= b - 1 && curr <= c) {
          cout << 'X';
        } else {
          curr++;
          cout << 'R';
        }
      }
      exp = a + 1;
    }
    if (curr != f) {
      while (curr != f) {
        cout << 'R';
        curr++;
      }
    }
  } else {
    for (auto x : v) {
      long long int a = get<0>(x);
      long long int b = get<1>(x);
      long long int c = get<2>(x);
      if (curr == f) break;
      if (a != exp) {
        while (a != exp && curr != f) {
          exp++;
          curr--;
          cout << 'L';
        }
      }
      if (a == exp && curr != f) {
        if (curr >= b && curr - 1 <= c) {
          cout << 'X';
        } else {
          curr--;
          cout << 'L';
        }
      }
      exp = a + 1;
    }
    if (curr != f) {
      while (curr != f) {
        cout << 'L';
        curr--;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  while (T--) {
    solve();
    cout << '\n';
  }
  return 0;
}
