#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<char> vc;
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define LB lower_bound
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i > b; i--)
#define cy cout << "YES"<<endl
#define cn cout<<"NO"<<endl
#define c(the_variable) cout<<the_variable<<endl;
#define PI 3.14159265358979323846

void FAST() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int Rselect(vector<int>&, int, int, int); //finding the ith order statistic
int partition(vector<int>&, int, int);
void scanc(vc& v,ll n)
{
    f(i,0,n)
    {
        char num;
        cin>>num;
        v.pub(num);
    }
}
template<typename T>
ostream& operator<<(ostream& stream, const vector<T>& vec) //outputting a vector
{
    for (auto& i : vec)
    {
        stream << i << ' ';
    }
    stream << '\n';
    return stream;
}

template<class T>
istream& operator>>(istream& stream, vector<T>& vec) //input for vectors of fixed size
{
    for (auto& i : vec)
    {
        stream >> i;
    }
    return stream;
}

/*void sieve()
{
    spf[1] = 1;
    for (ll i=2; i<MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)

                // marking spf[j] if it is not
                // previously marked
                {
                if (spf[j]==j)
                    spf[j] = i;
                }
        }
    }
}
vector<ll> getFactorization(ll x)
{
    vector<ll> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */

void scanN(vector<ll>&v,ll n)
{
    f(i,0,n)
    {
        int num;
        cin>>num;
        v.pub(num);
    }
}
void scans(vector<string>& v,ll n)
{
    f(i,0,n)
    {
        string s;
        cin>>s;
        v.pub(s);
    }
}

ll modfactorial(ll n,ll p)
{
    if(n>=p)
    return 0;
    ll result = 1;
    f(i,1,n+1)
    {
        result = result*i;
        result = result%p;
    }
    return result;
}
ll MI(ll a, ll b,ll s0,ll s1)
{
    ll k = b;
    if(b == 0)
    return s0;
    else
    {
       return  MI(b,a%b,s1,s0-s1*(a/b));

    }
}
ll choose(ll a,ll b,ll c)
{
    if(a<b)
    return 0;
    ll x = modfactorial(a,c);
    ll y = modfactorial(b,c);
    ll z = modfactorial(a-b,c);
    ll y_ = MI(y,c,1,0);
    if(y_<0)
    y_ = y_+c;
    ll z_ = MI(z,c,1,0);
    if(z_<0)
    z_ = z_+c;
    ll mul = (x*y_)%c;
    mul = (mul*z_)%c;
    return mul;
}

ll modpow(ll n,ll p,ll k)
{
    if(p == 0)
    return 1;
    ll result = 1;
    ll i = 1;
    while(i<=p)
    {
        result = result*n;
        result = result%k;
    }
    return result;
}
bool isPrime(int a) {
    for(int i = 2; i * i <= a; ++i)
        if(a % i == 0)
            return false;
    return true;
}

bool useflushdivisible(ll a) {
    cout<<a<<endl;
    fflush(stdout);
    char sl[10];
    scanf("%s", sl);
    return sl[0] == 'y' || sl[0] == 'Y';
}
ll phi(ll n)
{
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n =n/ i;
            result =result - result / i;
        }
    }
    if (n > 1)
        result =result - result / n;
    return result;
}
ll query(ll i,ll j)
{
    cout<<"? "<<i<<" "<<j<<endl;
    fflush(stdout);
    ll num;
    cin>>num;
    return num;
}
void merge(int a[], int head, int mid,int tail, bool increasing=false)
{
    int *c = new int[tail-head+1];
    int i=head, j=mid, k=0;
    while(k<tail-head+1)
    {
        if(( ((a[i]>a[j] &&increasing)|| (a[i]<a[j] && !increasing) )  || i==mid)&&j!=tail+1)
        {
            c[k]=a[j];
            j++;
        }
        else
        {
            c[k]=a[i];
            i++;
        }
        k++;
    }
    i=0;
    while(i<k)
    {
        a[head+i]=c[i];
        i++;
    }
    delete[] c;
}
void mergesort(int a[],int head,int tail)
{
    if(head!=tail)
    {
        mergesort(a, head, (tail-head+1)/2+head-1);
        mergesort(a, (tail-head+1)/2+head, tail);
        merge(a,head, (tail-head+1)/2+head,tail);
    }
}

void solve()
{
    int l,r,s,n,m,t,f;
    cin>>n>>m>>s>>f;
    f(i,0,m)
    {
        cin>>t>>l>>r;
        if(s!=f)
        {
            if(f>s)
            {
                if(s>r||s+1<l)
                {
                    s++;
                    cout<<"R";
                }
                else
                    cout<<"X";
            }
            else if(f<s)
            {
                if(s<l||s-1>r)
                {
                    s--;
                    cout<<"L";
                }
                else
                    cout<<"X";
            }
        }
        else
        {
            cout<<"X";
        }

    }
    while(f>s)
    {
        s++;
        cout<<"R";
    }
    while(f<s)
    {
        s--;
        cout<<"L";
    }
}

void SOLT()
{
    int test;
    cin>>test;
    while(test--)
    {
        solve();
    }
}
int main()
{
    FAST();

  // SOLT();
  solve();
    return 0;
}

int Rselect(vector<int>& v, int i, int l, int r)
{
    if (l == r)
        return v[l];
    int pivot = partition(v, l, r);
    if (pivot == i)
        return v[pivot - 1];
    else if (pivot < i)
    {
        return Rselect(v, i, pivot, r);
    }
    else
    {
        return Rselect(v, i, l, pivot - 2);
    }
}

int partition(vector<int>& v, int l, int r)
{
    int pivot_index = rand() % (r - l + 1) + l;
    swap(v[pivot_index], v[l]);
    int i = l + 1, j = l + 1;
    while (j <= r)
    {
        if (v[j] < v[l])
        {
            swap(v[j], v[i]);
            i++;
        }
        j++;
    }
    swap(v[l], v[i - 1]);
    return i;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<char> vc;
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define LB lower_bound
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i > b; i--)
#define cy cout << "YES"<<endl
#define cn cout<<"NO"<<endl
#define c(the_variable) cout<<the_variable<<endl;
#define PI 3.14159265358979323846

void FAST() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int Rselect(vector<int>&, int, int, int); //finding the ith order statistic
int partition(vector<int>&, int, int);
void scanc(vc& v,ll n)
{
    f(i,0,n)
    {
        char num;
        cin>>num;
        v.pub(num);
    }
}
template<typename T>
ostream& operator<<(ostream& stream, const vector<T>& vec) //outputting a vector
{
    for (auto& i : vec)
    {
        stream << i << ' ';
    }
    stream << '\n';
    return stream;
}

template<class T>
istream& operator>>(istream& stream, vector<T>& vec) //input for vectors of fixed size
{
    for (auto& i : vec)
    {
        stream >> i;
    }
    return stream;
}

/*void sieve()
{
    spf[1] = 1;
    for (ll i=2; i<MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)

                // marking spf[j] if it is not
                // previously marked
                {
                if (spf[j]==j)
                    spf[j] = i;
                }
        }
    }
}
vector<ll> getFactorization(ll x)
{
    vector<ll> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */

void scanN(vector<ll>&v,ll n)
{
    f(i,0,n)
    {
        int num;
        cin>>num;
        v.pub(num);
    }
}
void scans(vector<string>& v,ll n)
{
    f(i,0,n)
    {
        string s;
        cin>>s;
        v.pub(s);
    }
}

ll modfactorial(ll n,ll p)
{
    if(n>=p)
    return 0;
    ll result = 1;
    f(i,1,n+1)
    {
        result = result*i;
        result = result%p;
    }
    return result;
}
ll MI(ll a, ll b,ll s0,ll s1)
{
    ll k = b;
    if(b == 0)
    return s0;
    else
    {
       return  MI(b,a%b,s1,s0-s1*(a/b));

    }
}
ll choose(ll a,ll b,ll c)
{
    if(a<b)
    return 0;
    ll x = modfactorial(a,c);
    ll y = modfactorial(b,c);
    ll z = modfactorial(a-b,c);
    ll y_ = MI(y,c,1,0);
    if(y_<0)
    y_ = y_+c;
    ll z_ = MI(z,c,1,0);
    if(z_<0)
    z_ = z_+c;
    ll mul = (x*y_)%c;
    mul = (mul*z_)%c;
    return mul;
}

ll modpow(ll n,ll p,ll k)
{
    if(p == 0)
    return 1;
    ll result = 1;
    ll i = 1;
    while(i<=p)
    {
        result = result*n;
        result = result%k;
    }
    return result;
}
bool isPrime(int a) {
    for(int i = 2; i * i <= a; ++i)
        if(a % i == 0)
            return false;
    return true;
}

bool useflushdivisible(ll a) {
    cout<<a<<endl;
    fflush(stdout);
    char sl[10];
    scanf("%s", sl);
    return sl[0] == 'y' || sl[0] == 'Y';
}
ll phi(ll n)
{
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n =n/ i;
            result =result - result / i;
        }
    }
    if (n > 1)
        result =result - result / n;
    return result;
}
ll query(ll i,ll j)
{
    cout<<"? "<<i<<" "<<j<<endl;
    fflush(stdout);
    ll num;
    cin>>num;
    return num;
}
void merge(int a[], int head, int mid,int tail, bool increasing=false)
{
    int *c = new int[tail-head+1];
    int i=head, j=mid, k=0;
    while(k<tail-head+1)
    {
        if(( ((a[i]>a[j] &&increasing)|| (a[i]<a[j] && !increasing) )  || i==mid)&&j!=tail+1)
        {
            c[k]=a[j];
            j++;
        }
        else
        {
            c[k]=a[i];
            i++;
        }
        k++;
    }
    i=0;
    while(i<k)
    {
        a[head+i]=c[i];
        i++;
    }
    delete[] c;
}
void mergesort(int a[],int head,int tail)
{
    if(head!=tail)
    {
        mergesort(a, head, (tail-head+1)/2+head-1);
        mergesort(a, (tail-head+1)/2+head, tail);
        merge(a,head, (tail-head+1)/2+head,tail);
    }
}

void solve()
{
    int l,r,s,n,m,t,f;
    cin>>n>>m>>s>>f;
    f(i,0,m)
    {
        cin>>t>>l>>r;
        if(s!=f)
        {
            if(f>s)
            {
                if(s>r||s+1<l)
                {
                    s++;
                    cout<<"R";
                }
                else
                    cout<<"X";
            }
            else if(f<s)
            {
                if(s<l||s-1>r)
                {
                    s--;
                    cout<<"L";
                }
                else
                    cout<<"X";
            }
        }
        else
        {
            break;
        }

    }
    while(f>s)
    {
        s++;
        cout<<"R";
    }
    while(f<s)
    {
        s--;
        cout<<"L";
    }
}

void SOLT()
{
    int test;
    cin>>test;
    while(test--)
    {
        solve();
    }
}
int main()
{
    FAST();

  // SOLT();
  solve();
    return 0;
}

int Rselect(vector<int>& v, int i, int l, int r)
{
    if (l == r)
        return v[l];
    int pivot = partition(v, l, r);
    if (pivot == i)
        return v[pivot - 1];
    else if (pivot < i)
    {
        return Rselect(v, i, pivot, r);
    }
    else
    {
        return Rselect(v, i, l, pivot - 2);
    }
}

int partition(vector<int>& v, int l, int r)
{
    int pivot_index = rand() % (r - l + 1) + l;
    swap(v[pivot_index], v[l]);
    int i = l + 1, j = l + 1;
    while (j <= r)
    {
        if (v[j] < v[l])
        {
            swap(v[j], v[i]);
            i++;
        }
        j++;
    }
    swap(v[l], v[i - 1]);
    return i;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<char> vc;
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define LB lower_bound
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i > b; i--)
#define cy cout << "YES"<<endl
#define cn cout<<"NO"<<endl
#define c(the_variable) cout<<the_variable<<endl;
#define PI 3.14159265358979323846

void FAST() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int Rselect(vector<int>&, int, int, int); //finding the ith order statistic
int partition(vector<int>&, int, int);
void scanc(vc& v,ll n)
{
    f(i,0,n)
    {
        char num;
        cin>>num;
        v.pub(num);
    }
}
template<typename T>
ostream& operator<<(ostream& stream, const vector<T>& vec) //outputting a vector
{
    for (auto& i : vec)
    {
        stream << i << ' ';
    }
    stream << '\n';
    return stream;
}

template<class T>
istream& operator>>(istream& stream, vector<T>& vec) //input for vectors of fixed size
{
    for (auto& i : vec)
    {
        stream >> i;
    }
    return stream;
}

/*void sieve()
{
    spf[1] = 1;
    for (ll i=2; i<MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)

                // marking spf[j] if it is not
                // previously marked
                {
                if (spf[j]==j)
                    spf[j] = i;
                }
        }
    }
}
vector<ll> getFactorization(ll x)
{
    vector<ll> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */

void scanN(vector<ll>&v,ll n)
{
    f(i,0,n)
    {
        int num;
        cin>>num;
        v.pub(num);
    }
}
void scans(vector<string>& v,ll n)
{
    f(i,0,n)
    {
        string s;
        cin>>s;
        v.pub(s);
    }
}

ll modfactorial(ll n,ll p)
{
    if(n>=p)
    return 0;
    ll result = 1;
    f(i,1,n+1)
    {
        result = result*i;
        result = result%p;
    }
    return result;
}
ll MI(ll a, ll b,ll s0,ll s1)
{
    ll k = b;
    if(b == 0)
    return s0;
    else
    {
       return  MI(b,a%b,s1,s0-s1*(a/b));

    }
}
ll choose(ll a,ll b,ll c)
{
    if(a<b)
    return 0;
    ll x = modfactorial(a,c);
    ll y = modfactorial(b,c);
    ll z = modfactorial(a-b,c);
    ll y_ = MI(y,c,1,0);
    if(y_<0)
    y_ = y_+c;
    ll z_ = MI(z,c,1,0);
    if(z_<0)
    z_ = z_+c;
    ll mul = (x*y_)%c;
    mul = (mul*z_)%c;
    return mul;
}

ll modpow(ll n,ll p,ll k)
{
    if(p == 0)
    return 1;
    ll result = 1;
    ll i = 1;
    while(i<=p)
    {
        result = result*n;
        result = result%k;
    }
    return result;
}
bool isPrime(int a) {
    for(int i = 2; i * i <= a; ++i)
        if(a % i == 0)
            return false;
    return true;
}

bool useflushdivisible(ll a) {
    cout<<a<<endl;
    fflush(stdout);
    char sl[10];
    scanf("%s", sl);
    return sl[0] == 'y' || sl[0] == 'Y';
}
ll phi(ll n)
{
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n =n/ i;
            result =result - result / i;
        }
    }
    if (n > 1)
        result =result - result / n;
    return result;
}
ll query(ll i,ll j)
{
    cout<<"? "<<i<<" "<<j<<endl;
    fflush(stdout);
    ll num;
    cin>>num;
    return num;
}
void merge(int a[], int head, int mid,int tail, bool increasing=false)
{
    int *c = new int[tail-head+1];
    int i=head, j=mid, k=0;
    while(k<tail-head+1)
    {
        if(( ((a[i]>a[j] &&increasing)|| (a[i]<a[j] && !increasing) )  || i==mid)&&j!=tail+1)
        {
            c[k]=a[j];
            j++;
        }
        else
        {
            c[k]=a[i];
            i++;
        }
        k++;
    }
    i=0;
    while(i<k)
    {
        a[head+i]=c[i];
        i++;
    }
    delete[] c;
}
void mergesort(int a[],int head,int tail)
{
    if(head!=tail)
    {
        mergesort(a, head, (tail-head+1)/2+head-1);
        mergesort(a, (tail-head+1)/2+head, tail);
        merge(a,head, (tail-head+1)/2+head,tail);
    }
}

void solve()
{
    int l,r,s,n,m,t,f;
    cin>>n>>m>>s>>f;
    f(i,0,m)
    {
        cin>>t>>l>>r;
        if(s!=f)
        {
            if(f>s)
            {
                if(s>r||s+1<l)
                {
                    s++;
                    cout<<"R";
                }
                else
                    cout<<"X";
            }
            else if(f<s)
            {
                if(s<l||s-1>r)
                {
                    s--;
                    cout<<"L";
                }
                else
                    cout<<"X";
            }
        }
        else
        {
            break;
        }
    }
}

void SOLT()
{
    int test;
    cin>>test;
    while(test--)
    {
        solve();
    }
}
int main()
{
    FAST();

  // SOLT();
  solve();
    return 0;
}

int Rselect(vector<int>& v, int i, int l, int r)
{
    if (l == r)
        return v[l];
    int pivot = partition(v, l, r);
    if (pivot == i)
        return v[pivot - 1];
    else if (pivot < i)
    {
        return Rselect(v, i, pivot, r);
    }
    else
    {
        return Rselect(v, i, l, pivot - 2);
    }
}

int partition(vector<int>& v, int l, int r)
{
    int pivot_index = rand() % (r - l + 1) + l;
    swap(v[pivot_index], v[l]);
    int i = l + 1, j = l + 1;
    while (j <= r)
    {
        if (v[j] < v[l])
        {
            swap(v[j], v[i]);
            i++;
        }
        j++;
    }
    swap(v[l], v[i - 1]);
    return i;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<char> vc;
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define LB lower_bound
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i > b; i--)
#define cy cout << "YES"<<endl
#define cn cout<<"NO"<<endl
#define c(the_variable) cout<<the_variable<<endl;
#define PI 3.14159265358979323846

void FAST() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int Rselect(vector<int>&, int, int, int); //finding the ith order statistic
int partition(vector<int>&, int, int);
void scanc(vc& v,ll n)
{
    f(i,0,n)
    {
        char num;
        cin>>num;
        v.pub(num);
    }
}
template<typename T>
ostream& operator<<(ostream& stream, const vector<T>& vec) //outputting a vector
{
    for (auto& i : vec)
    {
        stream << i << ' ';
    }
    stream << '\n';
    return stream;
}

template<class T>
istream& operator>>(istream& stream, vector<T>& vec) //input for vectors of fixed size
{
    for (auto& i : vec)
    {
        stream >> i;
    }
    return stream;
}

/*void sieve()
{
    spf[1] = 1;
    for (ll i=2; i<MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)

                // marking spf[j] if it is not
                // previously marked
                {
                if (spf[j]==j)
                    spf[j] = i;
                }
        }
    }
}
vector<ll> getFactorization(ll x)
{
    vector<ll> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */

void scanN(vector<ll>&v,ll n)
{
    f(i,0,n)
    {
        int num;
        cin>>num;
        v.pub(num);
    }
}
void scans(vector<string>& v,ll n)
{
    f(i,0,n)
    {
        string s;
        cin>>s;
        v.pub(s);
    }
}

ll modfactorial(ll n,ll p)
{
    if(n>=p)
    return 0;
    ll result = 1;
    f(i,1,n+1)
    {
        result = result*i;
        result = result%p;
    }
    return result;
}
ll MI(ll a, ll b,ll s0,ll s1)
{
    ll k = b;
    if(b == 0)
    return s0;
    else
    {
       return  MI(b,a%b,s1,s0-s1*(a/b));

    }
}
ll choose(ll a,ll b,ll c)
{
    if(a<b)
    return 0;
    ll x = modfactorial(a,c);
    ll y = modfactorial(b,c);
    ll z = modfactorial(a-b,c);
    ll y_ = MI(y,c,1,0);
    if(y_<0)
    y_ = y_+c;
    ll z_ = MI(z,c,1,0);
    if(z_<0)
    z_ = z_+c;
    ll mul = (x*y_)%c;
    mul = (mul*z_)%c;
    return mul;
}

ll modpow(ll n,ll p,ll k)
{
    if(p == 0)
    return 1;
    ll result = 1;
    ll i = 1;
    while(i<=p)
    {
        result = result*n;
        result = result%k;
    }
    return result;
}
bool isPrime(int a) {
    for(int i = 2; i * i <= a; ++i)
        if(a % i == 0)
            return false;
    return true;
}

bool useflushdivisible(ll a) {
    cout<<a<<endl;
    fflush(stdout);
    char sl[10];
    scanf("%s", sl);
    return sl[0] == 'y' || sl[0] == 'Y';
}
ll phi(ll n)
{
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n =n/ i;
            result =result - result / i;
        }
    }
    if (n > 1)
        result =result - result / n;
    return result;
}
ll query(ll i,ll j)
{
    cout<<"? "<<i<<" "<<j<<endl;
    fflush(stdout);
    ll num;
    cin>>num;
    return num;
}
void merge(int a[], int head, int mid,int tail, bool increasing=false)
{
    int *c = new int[tail-head+1];
    int i=head, j=mid, k=0;
    while(k<tail-head+1)
    {
        if(( ((a[i]>a[j] &&increasing)|| (a[i]<a[j] && !increasing) )  || i==mid)&&j!=tail+1)
        {
            c[k]=a[j];
            j++;
        }
        else
        {
            c[k]=a[i];
            i++;
        }
        k++;
    }
    i=0;
    while(i<k)
    {
        a[head+i]=c[i];
        i++;
    }
    delete[] c;
}
void mergesort(int a[],int head,int tail)
{
    if(head!=tail)
    {
        mergesort(a, head, (tail-head+1)/2+head-1);
        mergesort(a, (tail-head+1)/2+head, tail);
        merge(a,head, (tail-head+1)/2+head,tail);
    }
}

void solve()
{
    int l,r,s,n,m,t,f,pre=0;
    cin>>n>>m>>s>>f;
    f(i,0,m)
    {

        cin>>t>>l>>r;
        while(pre<t-1)
        {
            if(f>s)
            {
                cout<<"R";
                s++;
            }
            else if(f<s)
            {
                cout<<"L";
                s--;
            }
            pre++;
        }
        if(s!=f)
        {
            if(f>s)
            {
                if(s>r||s+1<l)
                {
                    s++;
                    cout<<"R";
                }
                else
                    cout<<"X";
            }
            else if(f<s)
            {
                if(s<l||s-1>r)
                {
                    s--;
                    cout<<"L";
                }
                else
                    cout<<"X";
            }
        }
        else
        {
            break;
        }
        pre=t;
    }
    while(f>s)
    {
        s++;
        cout<<"R";
    }
    while(f<s)
    {
        s--;
        cout<<"L";
    }
}

void SOLT()
{
    int test;
    cin>>test;
    while(test--)
    {
        solve();
    }
}
int main()
{
    FAST();

  // SOLT();
  solve();
    return 0;
}

int Rselect(vector<int>& v, int i, int l, int r)
{
    if (l == r)
        return v[l];
    int pivot = partition(v, l, r);
    if (pivot == i)
        return v[pivot - 1];
    else if (pivot < i)
    {
        return Rselect(v, i, pivot, r);
    }
    else
    {
        return Rselect(v, i, l, pivot - 2);
    }
}

int partition(vector<int>& v, int l, int r)
{
    int pivot_index = rand() % (r - l + 1) + l;
    swap(v[pivot_index], v[l]);
    int i = l + 1, j = l + 1;
    while (j <= r)
    {
        if (v[j] < v[l])
        {
            swap(v[j], v[i]);
            i++;
        }
        j++;
    }
    swap(v[l], v[i - 1]);
    return i;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<char> vc;
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define LB lower_bound
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i > b; i--)
#define cy cout << "YES"<<endl
#define cn cout<<"NO"<<endl
#define c(the_variable) cout<<the_variable<<endl;
#define PI 3.14159265358979323846

void FAST() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int Rselect(vector<int>&, int, int, int); //finding the ith order statistic
int partition(vector<int>&, int, int);
void scanc(vc& v,ll n)
{
    f(i,0,n)
    {
        char num;
        cin>>num;
        v.pub(num);
    }
}
template<typename T>
ostream& operator<<(ostream& stream, const vector<T>& vec) //outputting a vector
{
    for (auto& i : vec)
    {
        stream << i << ' ';
    }
    stream << '\n';
    return stream;
}

template<class T>
istream& operator>>(istream& stream, vector<T>& vec) //input for vectors of fixed size
{
    for (auto& i : vec)
    {
        stream >> i;
    }
    return stream;
}

/*void sieve()
{
    spf[1] = 1;
    for (ll i=2; i<MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)

                // marking spf[j] if it is not
                // previously marked
                {
                if (spf[j]==j)
                    spf[j] = i;
                }
        }
    }
}
vector<ll> getFactorization(ll x)
{
    vector<ll> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */

void scanN(vector<ll>&v,ll n)
{
    f(i,0,n)
    {
        int num;
        cin>>num;
        v.pub(num);
    }
}
void scans(vector<string>& v,ll n)
{
    f(i,0,n)
    {
        string s;
        cin>>s;
        v.pub(s);
    }
}

ll modfactorial(ll n,ll p)
{
    if(n>=p)
    return 0;
    ll result = 1;
    f(i,1,n+1)
    {
        result = result*i;
        result = result%p;
    }
    return result;
}
ll MI(ll a, ll b,ll s0,ll s1)
{
    ll k = b;
    if(b == 0)
    return s0;
    else
    {
       return  MI(b,a%b,s1,s0-s1*(a/b));

    }
}
ll choose(ll a,ll b,ll c)
{
    if(a<b)
    return 0;
    ll x = modfactorial(a,c);
    ll y = modfactorial(b,c);
    ll z = modfactorial(a-b,c);
    ll y_ = MI(y,c,1,0);
    if(y_<0)
    y_ = y_+c;
    ll z_ = MI(z,c,1,0);
    if(z_<0)
    z_ = z_+c;
    ll mul = (x*y_)%c;
    mul = (mul*z_)%c;
    return mul;
}

ll modpow(ll n,ll p,ll k)
{
    if(p == 0)
    return 1;
    ll result = 1;
    ll i = 1;
    while(i<=p)
    {
        result = result*n;
        result = result%k;
    }
    return result;
}
bool isPrime(int a) {
    for(int i = 2; i * i <= a; ++i)
        if(a % i == 0)
            return false;
    return true;
}

bool useflushdivisible(ll a) {
    cout<<a<<endl;
    fflush(stdout);
    char sl[10];
    scanf("%s", sl);
    return sl[0] == 'y' || sl[0] == 'Y';
}
ll phi(ll n)
{
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n =n/ i;
            result =result - result / i;
        }
    }
    if (n > 1)
        result =result - result / n;
    return result;
}
ll query(ll i,ll j)
{
    cout<<"? "<<i<<" "<<j<<endl;
    fflush(stdout);
    ll num;
    cin>>num;
    return num;
}
void merge(int a[], int head, int mid,int tail, bool increasing=false)
{
    int *c = new int[tail-head+1];
    int i=head, j=mid, k=0;
    while(k<tail-head+1)
    {
        if(( ((a[i]>a[j] &&increasing)|| (a[i]<a[j] && !increasing) )  || i==mid)&&j!=tail+1)
        {
            c[k]=a[j];
            j++;
        }
        else
        {
            c[k]=a[i];
            i++;
        }
        k++;
    }
    i=0;
    while(i<k)
    {
        a[head+i]=c[i];
        i++;
    }
    delete[] c;
}
void mergesort(int a[],int head,int tail)
{
    if(head!=tail)
    {
        mergesort(a, head, (tail-head+1)/2+head-1);
        mergesort(a, (tail-head+1)/2+head, tail);
        merge(a,head, (tail-head+1)/2+head,tail);
    }
}

void solve()
{
    int l,r,s,n,m,t,f,pre=0;
    cin>>n>>m>>s>>f;
    f(i,0,m)
    {

        cin>>t>>l>>r;
        while(pre<t-1)
        {
            if(f>s)
                cout<<"R";
            else if(f<s)
                cout<<"L";
            pre++;
        }
        if(s!=f)
        {
            if(f>s)
            {
                if(s>r||s+1<l)
                {
                    s++;
                    cout<<"R";
                }
                else
                    cout<<"X";
            }
            else if(f<s)
            {
                if(s<l||s-1>r)
                {
                    s--;
                    cout<<"L";
                }
                else
                    cout<<"X";
            }
        }
        else
        {
            break;
        }
        pre=t;
    }
    while(f>s)
    {
        s++;
        cout<<"R";
    }
    while(f<s)
    {
        s--;
        cout<<"L";
    }
}

void SOLT()
{
    int test;
    cin>>test;
    while(test--)
    {
        solve();
    }
}
int main()
{
    FAST();

  // SOLT();
  solve();
    return 0;
}

int Rselect(vector<int>& v, int i, int l, int r)
{
    if (l == r)
        return v[l];
    int pivot = partition(v, l, r);
    if (pivot == i)
        return v[pivot - 1];
    else if (pivot < i)
    {
        return Rselect(v, i, pivot, r);
    }
    else
    {
        return Rselect(v, i, l, pivot - 2);
    }
}

int partition(vector<int>& v, int l, int r)
{
    int pivot_index = rand() % (r - l + 1) + l;
    swap(v[pivot_index], v[l]);
    int i = l + 1, j = l + 1;
    while (j <= r)
    {
        if (v[j] < v[l])
        {
            swap(v[j], v[i]);
            i++;
        }
        j++;
    }
    swap(v[l], v[i - 1]);
    return i;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<char> vc;
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define LB lower_bound
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i > b; i--)
#define cy cout << "YES"<<endl
#define cn cout<<"NO"<<endl
#define c(the_variable) cout<<the_variable<<endl;
#define PI 3.14159265358979323846

void FAST() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int Rselect(vector<int>&, int, int, int); //finding the ith order statistic
int partition(vector<int>&, int, int);
void scanc(vc& v,ll n)
{
    f(i,0,n)
    {
        char num;
        cin>>num;
        v.pub(num);
    }
}
template<typename T>
ostream& operator<<(ostream& stream, const vector<T>& vec) //outputting a vector
{
    for (auto& i : vec)
    {
        stream << i << ' ';
    }
    stream << '\n';
    return stream;
}

template<class T>
istream& operator>>(istream& stream, vector<T>& vec) //input for vectors of fixed size
{
    for (auto& i : vec)
    {
        stream >> i;
    }
    return stream;
}

/*void sieve()
{
    spf[1] = 1;
    for (ll i=2; i<MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)

                // marking spf[j] if it is not
                // previously marked
                {
                if (spf[j]==j)
                    spf[j] = i;
                }
        }
    }
}
vector<ll> getFactorization(ll x)
{
    vector<ll> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */

void scanN(vector<ll>&v,ll n)
{
    f(i,0,n)
    {
        int num;
        cin>>num;
        v.pub(num);
    }
}
void scans(vector<string>& v,ll n)
{
    f(i,0,n)
    {
        string s;
        cin>>s;
        v.pub(s);
    }
}

ll modfactorial(ll n,ll p)
{
    if(n>=p)
    return 0;
    ll result = 1;
    f(i,1,n+1)
    {
        result = result*i;
        result = result%p;
    }
    return result;
}
ll MI(ll a, ll b,ll s0,ll s1)
{
    ll k = b;
    if(b == 0)
    return s0;
    else
    {
       return  MI(b,a%b,s1,s0-s1*(a/b));

    }
}
ll choose(ll a,ll b,ll c)
{
    if(a<b)
    return 0;
    ll x = modfactorial(a,c);
    ll y = modfactorial(b,c);
    ll z = modfactorial(a-b,c);
    ll y_ = MI(y,c,1,0);
    if(y_<0)
    y_ = y_+c;
    ll z_ = MI(z,c,1,0);
    if(z_<0)
    z_ = z_+c;
    ll mul = (x*y_)%c;
    mul = (mul*z_)%c;
    return mul;
}

ll modpow(ll n,ll p,ll k)
{
    if(p == 0)
    return 1;
    ll result = 1;
    ll i = 1;
    while(i<=p)
    {
        result = result*n;
        result = result%k;
    }
    return result;
}
bool isPrime(int a) {
    for(int i = 2; i * i <= a; ++i)
        if(a % i == 0)
            return false;
    return true;
}

bool useflushdivisible(ll a) {
    cout<<a<<endl;
    fflush(stdout);
    char sl[10];
    scanf("%s", sl);
    return sl[0] == 'y' || sl[0] == 'Y';
}
ll phi(ll n)
{
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n =n/ i;
            result =result - result / i;
        }
    }
    if (n > 1)
        result =result - result / n;
    return result;
}
ll query(ll i,ll j)
{
    cout<<"? "<<i<<" "<<j<<endl;
    fflush(stdout);
    ll num;
    cin>>num;
    return num;
}
void merge(int a[], int head, int mid,int tail, bool increasing=false)
{
    int *c = new int[tail-head+1];
    int i=head, j=mid, k=0;
    while(k<tail-head+1)
    {
        if(( ((a[i]>a[j] &&increasing)|| (a[i]<a[j] && !increasing) )  || i==mid)&&j!=tail+1)
        {
            c[k]=a[j];
            j++;
        }
        else
        {
            c[k]=a[i];
            i++;
        }
        k++;
    }
    i=0;
    while(i<k)
    {
        a[head+i]=c[i];
        i++;
    }
    delete[] c;
}
void mergesort(int a[],int head,int tail)
{
    if(head!=tail)
    {
        mergesort(a, head, (tail-head+1)/2+head-1);
        mergesort(a, (tail-head+1)/2+head, tail);
        merge(a,head, (tail-head+1)/2+head,tail);
    }
}

void solve()
{
    int l,r,s,n,m,t,f;
    cin>>n>>m>>s>>f;
    f(i,0,m)
    {
        cin>>t>>l>>r;
        if(s!=f)
        {
            //while(t--)
            {
                if(f>s)
                {
                    if(s>r||s+1<l)
                    {
                        s++;
                        cout<<"R";
                    }
                    else
                        cout<<"X";
                }
                else if(f<s)
                {
                    if(s<l||s-1>r)
                    {
                        s++;
                        cout<<"L";
                    }
                    else
                        cout<<"X";
                }
            }
        }
    }
    while(f>s)
    {
        s++;
        cout<<"R";
    }
    while(f<s)
    {
        s--;
        cout<<"L";
    }
}

void SOLT()
{
    int test;
    cin>>test;
    while(test--)
    {
        solve();
    }
}
int main()
{
    FAST();

  // SOLT();
  solve();
    return 0;
}

int Rselect(vector<int>& v, int i, int l, int r)
{
    if (l == r)
        return v[l];
    int pivot = partition(v, l, r);
    if (pivot == i)
        return v[pivot - 1];
    else if (pivot < i)
    {
        return Rselect(v, i, pivot, r);
    }
    else
    {
        return Rselect(v, i, l, pivot - 2);
    }
}

int partition(vector<int>& v, int l, int r)
{
    int pivot_index = rand() % (r - l + 1) + l;
    swap(v[pivot_index], v[l]);
    int i = l + 1, j = l + 1;
    while (j <= r)
    {
        if (v[j] < v[l])
        {
            swap(v[j], v[i]);
            i++;
        }
        j++;
    }
    swap(v[l], v[i - 1]);
    return i;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<char> vc;
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define LB lower_bound
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i > b; i--)
#define cy cout << "YES"<<endl
#define cn cout<<"NO"<<endl
#define c(the_variable) cout<<the_variable<<endl;
#define PI 3.14159265358979323846

void FAST() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int Rselect(vector<int>&, int, int, int); //finding the ith order statistic
int partition(vector<int>&, int, int);
void scanc(vc& v,ll n)
{
    f(i,0,n)
    {
        char num;
        cin>>num;
        v.pub(num);
    }
}
template<typename T>
ostream& operator<<(ostream& stream, const vector<T>& vec) //outputting a vector
{
    for (auto& i : vec)
    {
        stream << i << ' ';
    }
    stream << '\n';
    return stream;
}

template<class T>
istream& operator>>(istream& stream, vector<T>& vec) //input for vectors of fixed size
{
    for (auto& i : vec)
    {
        stream >> i;
    }
    return stream;
}

/*void sieve()
{
    spf[1] = 1;
    for (ll i=2; i<MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)

                // marking spf[j] if it is not
                // previously marked
                {
                if (spf[j]==j)
                    spf[j] = i;
                }
        }
    }
}
vector<ll> getFactorization(ll x)
{
    vector<ll> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */

void scanN(vector<ll>&v,ll n)
{
    f(i,0,n)
    {
        int num;
        cin>>num;
        v.pub(num);
    }
}
void scans(vector<string>& v,ll n)
{
    f(i,0,n)
    {
        string s;
        cin>>s;
        v.pub(s);
    }
}

ll modfactorial(ll n,ll p)
{
    if(n>=p)
    return 0;
    ll result = 1;
    f(i,1,n+1)
    {
        result = result*i;
        result = result%p;
    }
    return result;
}
ll MI(ll a, ll b,ll s0,ll s1)
{
    ll k = b;
    if(b == 0)
    return s0;
    else
    {
       return  MI(b,a%b,s1,s0-s1*(a/b));

    }
}
ll choose(ll a,ll b,ll c)
{
    if(a<b)
    return 0;
    ll x = modfactorial(a,c);
    ll y = modfactorial(b,c);
    ll z = modfactorial(a-b,c);
    ll y_ = MI(y,c,1,0);
    if(y_<0)
    y_ = y_+c;
    ll z_ = MI(z,c,1,0);
    if(z_<0)
    z_ = z_+c;
    ll mul = (x*y_)%c;
    mul = (mul*z_)%c;
    return mul;
}

ll modpow(ll n,ll p,ll k)
{
    if(p == 0)
    return 1;
    ll result = 1;
    ll i = 1;
    while(i<=p)
    {
        result = result*n;
        result = result%k;
    }
    return result;
}
bool isPrime(int a) {
    for(int i = 2; i * i <= a; ++i)
        if(a % i == 0)
            return false;
    return true;
}

bool useflushdivisible(ll a) {
    cout<<a<<endl;
    fflush(stdout);
    char sl[10];
    scanf("%s", sl);
    return sl[0] == 'y' || sl[0] == 'Y';
}
ll phi(ll n)
{
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n =n/ i;
            result =result - result / i;
        }
    }
    if (n > 1)
        result =result - result / n;
    return result;
}
ll query(ll i,ll j)
{
    cout<<"? "<<i<<" "<<j<<endl;
    fflush(stdout);
    ll num;
    cin>>num;
    return num;
}
void merge(int a[], int head, int mid,int tail, bool increasing=false)
{
    int *c = new int[tail-head+1];
    int i=head, j=mid, k=0;
    while(k<tail-head+1)
    {
        if(( ((a[i]>a[j] &&increasing)|| (a[i]<a[j] && !increasing) )  || i==mid)&&j!=tail+1)
        {
            c[k]=a[j];
            j++;
        }
        else
        {
            c[k]=a[i];
            i++;
        }
        k++;
    }
    i=0;
    while(i<k)
    {
        a[head+i]=c[i];
        i++;
    }
    delete[] c;
}
void mergesort(int a[],int head,int tail)
{
    if(head!=tail)
    {
        mergesort(a, head, (tail-head+1)/2+head-1);
        mergesort(a, (tail-head+1)/2+head, tail);
        merge(a,head, (tail-head+1)/2+head,tail);
    }
}

void solve()
{
    int l,r,s,n,m,t,f;
    cin>>n>>m>>s>>f;
    f(i,0,m)
    {
        cin>>t>>l>>r;
        if(s!=f)
        {
            if(f>s)
            {
                if(s>r||s+1<l)
                {
                    s++;
                    cout<<"R";
                }
                else
                    cout<<"X";
            }
            else if(f<s)
            {
                if(s<l||s-1>r)
                {
                    s--;
                    cout<<"L";
                }
                else
                    cout<<"X";
            }
        }
        else
        {
            break;
        }
    }
    cout<<endl;
}

void SOLT()
{
    int test;
    cin>>test;
    while(test--)
    {
        solve();
    }
}
int main()
{
    FAST();

  // SOLT();
  solve();
    return 0;
}

int Rselect(vector<int>& v, int i, int l, int r)
{
    if (l == r)
        return v[l];
    int pivot = partition(v, l, r);
    if (pivot == i)
        return v[pivot - 1];
    else if (pivot < i)
    {
        return Rselect(v, i, pivot, r);
    }
    else
    {
        return Rselect(v, i, l, pivot - 2);
    }
}

int partition(vector<int>& v, int l, int r)
{
    int pivot_index = rand() % (r - l + 1) + l;
    swap(v[pivot_index], v[l]);
    int i = l + 1, j = l + 1;
    while (j <= r)
    {
        if (v[j] < v[l])
        {
            swap(v[j], v[i]);
            i++;
        }
        j++;
    }
    swap(v[l], v[i - 1]);
    return i;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<char> vc;
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define LB lower_bound
#define f(i, a, b) for (int i = a; i < b; i++)
#define fr(i, a, b) for (int i = a; i > b; i--)
#define cy cout << "YES"<<endl
#define cn cout<<"NO"<<endl
#define c(the_variable) cout<<the_variable<<endl;
#define PI 3.14159265358979323846

void FAST() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
int Rselect(vector<int>&, int, int, int); //finding the ith order statistic
int partition(vector<int>&, int, int);
void scanc(vc& v,ll n)
{
    f(i,0,n)
    {
        char num;
        cin>>num;
        v.pub(num);
    }
}
template<typename T>
ostream& operator<<(ostream& stream, const vector<T>& vec) //outputting a vector
{
    for (auto& i : vec)
    {
        stream << i << ' ';
    }
    stream << '\n';
    return stream;
}

template<class T>
istream& operator>>(istream& stream, vector<T>& vec) //input for vectors of fixed size
{
    for (auto& i : vec)
    {
        stream >> i;
    }
    return stream;
}

/*void sieve()
{
    spf[1] = 1;
    for (ll i=2; i<MAXN; i++)

        // marking smallest prime factor for every
        // number to be itself.
        spf[i] = i;

    // separately marking spf for every even
    // number as 2
    for (ll i=4; i<MAXN; i+=2)
        spf[i] = 2;

    for (ll i=3; i*i<MAXN; i++)
    {
        // checking if i is prime
        if (spf[i] == i)
        {
            // marking SPF for all numbers divisible by i
            for (ll j=i*i; j<MAXN; j+=i)

                // marking spf[j] if it is not
                // previously marked
                {
                if (spf[j]==j)
                    spf[j] = i;
                }
        }
    }
}
vector<ll> getFactorization(ll x)
{
    vector<ll> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
} */

void scanN(vector<ll>&v,ll n)
{
    f(i,0,n)
    {
        int num;
        cin>>num;
        v.pub(num);
    }
}
void scans(vector<string>& v,ll n)
{
    f(i,0,n)
    {
        string s;
        cin>>s;
        v.pub(s);
    }
}

ll modfactorial(ll n,ll p)
{
    if(n>=p)
    return 0;
    ll result = 1;
    f(i,1,n+1)
    {
        result = result*i;
        result = result%p;
    }
    return result;
}
ll MI(ll a, ll b,ll s0,ll s1)
{
    ll k = b;
    if(b == 0)
    return s0;
    else
    {
       return  MI(b,a%b,s1,s0-s1*(a/b));

    }
}
ll choose(ll a,ll b,ll c)
{
    if(a<b)
    return 0;
    ll x = modfactorial(a,c);
    ll y = modfactorial(b,c);
    ll z = modfactorial(a-b,c);
    ll y_ = MI(y,c,1,0);
    if(y_<0)
    y_ = y_+c;
    ll z_ = MI(z,c,1,0);
    if(z_<0)
    z_ = z_+c;
    ll mul = (x*y_)%c;
    mul = (mul*z_)%c;
    return mul;
}

ll modpow(ll n,ll p,ll k)
{
    if(p == 0)
    return 1;
    ll result = 1;
    ll i = 1;
    while(i<=p)
    {
        result = result*n;
        result = result%k;
    }
    return result;
}
bool isPrime(int a) {
    for(int i = 2; i * i <= a; ++i)
        if(a % i == 0)
            return false;
    return true;
}

bool useflushdivisible(ll a) {
    cout<<a<<endl;
    fflush(stdout);
    char sl[10];
    scanf("%s", sl);
    return sl[0] == 'y' || sl[0] == 'Y';
}
ll phi(ll n)
{
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            while (n % i == 0)
                n =n/ i;
            result =result - result / i;
        }
    }
    if (n > 1)
        result =result - result / n;
    return result;
}
ll query(ll i,ll j)
{
    cout<<"? "<<i<<" "<<j<<endl;
    fflush(stdout);
    ll num;
    cin>>num;
    return num;
}
void merge(int a[], int head, int mid,int tail, bool increasing=false)
{
    int *c = new int[tail-head+1];
    int i=head, j=mid, k=0;
    while(k<tail-head+1)
    {
        if(( ((a[i]>a[j] &&increasing)|| (a[i]<a[j] && !increasing) )  || i==mid)&&j!=tail+1)
        {
            c[k]=a[j];
            j++;
        }
        else
        {
            c[k]=a[i];
            i++;
        }
        k++;
    }
    i=0;
    while(i<k)
    {
        a[head+i]=c[i];
        i++;
    }
    delete[] c;
}
void mergesort(int a[],int head,int tail)
{
    if(head!=tail)
    {
        mergesort(a, head, (tail-head+1)/2+head-1);
        mergesort(a, (tail-head+1)/2+head, tail);
        merge(a,head, (tail-head+1)/2+head,tail);
    }
}

void solve()
{
    int l,r,s,n,m,t,f;
    cin>>n>>m>>s>>f;
    f(i,0,m)
    {
        cin>>t>>l>>r;
        if(s==f)
        {
            s=s;
        }
        else
        {
            if(f>s)
            {
                if(s>r||s+1<l)
                {
                    s++;
                    cout<<"R";
                }
                else
                    cout<<"X";
            }
            else if(f<s)
            {
                if(s<l||s-1>r)
                {
                    s++;
                    cout<<"L";
                }
                else
                    cout<<"X";
            }
        }
    }
    while(f>s)
    {
        s++;
        cout<<"R";
    }
    while(f<s)
    {
        s--;
        cout<<"L";
    }
}

void SOLT()
{
    int test;
    cin>>test;
    while(test--)
    {
        solve();
    }
}
int main()
{
    FAST();

  // SOLT();
  solve();
    return 0;
}

int Rselect(vector<int>& v, int i, int l, int r)
{
    if (l == r)
        return v[l];
    int pivot = partition(v, l, r);
    if (pivot == i)
        return v[pivot - 1];
    else if (pivot < i)
    {
        return Rselect(v, i, pivot, r);
    }
    else
    {
        return Rselect(v, i, l, pivot - 2);
    }
}

int partition(vector<int>& v, int l, int r)
{
    int pivot_index = rand() % (r - l + 1) + l;
    swap(v[pivot_index], v[l]);
    int i = l + 1, j = l + 1;
    while (j <= r)
    {
        if (v[j] < v[l])
        {
            swap(v[j], v[i]);
            i++;
        }
        j++;
    }
    swap(v[l], v[i - 1]);
    return i;
}


#include<iostream>
using namespace std;
#define ll long long
int main(){
 int n,m,s,f;cin>>n>>m>>s>>f;
 while(m--){
 	int step,t,r;
 	cin>>step>>t>>r;
 	if(f>s){
 		if(s<t || s>r){
 			if((s+1)<t || (s+1)>r){
 				cout<<'R';
 				s=s+1;
 			}
 			else{
 				cout<<'X';
 			}
 		}
 		else cout<<'X';
 		if(f==s) return 0;
 	}
 	if(f==s){
 		if(s<t || s>r){
 			cout<<'X';
 			return 0;
 		}
 		else cout<<'X';
 	}
 	if(f<s){
		if(s<t || s>r){
			if((s-1)<t || (s-1)>r){
 				cout<<'L';
 				s=s-1;
 			}
 			else{
 				cout<<'X';
 			}
 		}
 		else cout<<'X';
 	}
 	if(f==s) return 0;
 }
}


#include<iostream>
using namespace std;
#define ll long long
int main(){
 int n,m,s,f,temp=1;cin>>n>>m>>s>>f;
 while(m--){
 	int step,t,r;
 	cin>>step>>t>>r;
 	if(step==temp){
	 	if(f>s){
	 		if(s<t || s>r){
	 			if((s+1)<t || (s+1)>r){
	 				cout<<'R';
	 				s=s+1;
	 			}
	 			else{
	 				cout<<'X';
	 			}
	 		}
	 		else cout<<'X';
	 		if(f==s) return 0;
	 	}
	 	if(f==s){
	 		if(s<t || s>r){
	 			cout<<'X';
	 			return 0;
	 		}
	 		else cout<<'X';
	 	}
	 	if(f<s){
			if(s<t || s>r){
				if((s-1)<t || (s-1)>r){
	 				cout<<'L';
	 				s=s-1;
	 			}
	 			else{
	 				cout<<'X';
	 			}
	 		}
	 		else cout<<'X';
	 	}
	 	if(f==s) return 0;
	 	temp++;
	}
	else{
		if(f==s) return 0;
		if(f>s) cout<<'R';
		if(f<s) cout<<'L';
		temp++;
	}

 }

}


#include<iostream>
using namespace std;
#define ll long long
int main(){
 int n,m,s,f,temp=1;cin>>n>>m>>s>>f;
 while(m--){
 	int step,t,r;
 	cin>>step>>t>>r;
 	//cout<<temp<<" "<<step<<endl;
 	if(step==temp){
	 	if(f>s){
	 		if(s<t || s>r){
	 			if((s+1)<t || (s+1)>r){
	 				cout<<'R';
	 				s=s+1;
	 			}
	 			else{
	 				cout<<'X';
	 			}
	 		}
	 		else cout<<'X';
	 		if(f==s) return 0;
	 	}

	 	if(f<s){
			if(s<t || s>r){
				if((s-1)<t || (s-1)>r){
	 				cout<<'L';
	 				s=s-1;
	 			}
	 			else{
	 				cout<<'X';
	 			}
	 		}
	 		else cout<<'X';
	 	}
	 	//cout<<f<<" "<<s<<endl;
	 	if(f==s) return 0;
	 	temp++;
	}
	else{
		//cout<<" "<<f<<" "<<s<<endl;
		if(f>s){
			for(int i=0;i<step-temp;i++){
				cout<<'R';s++;
			}
		}
		if(f<s){
			for(int i=0;i<step-temp;i++){
				cout<<'L';s--;
			}
		}
		//cout<<f<<" "<<s<<endl;
		if(f==s) return 0;
		temp=step;
	}

 }

}


#include <bits/stdc++.h>

#define ll long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

int main(){
	fastio
	int n,m,s,f,nt = 0;
	cin >> n >> m >> s >> f;
	char tmp = (s > f ? 'L' : 'R');
	string ans = "";
	for(int i = 0;i < m;i++){
		int t, l, r;
		cin >> t >> l >> r;
		while(nt < t&&s!=f){
			nt++;
			if(nt==t){
				if(s>=l&&s<=r) ans += 'X';
				else if(s+(s>f?-1:1)>=l&&s+(s>f?-1:1)<=r) ans+='X';
				else s+=(s>f?-1:1), ans+=tmp;
			}else if(nt<t){
				ans+=tmp;
			}
		}
	}
	cout << ans << "\n";
}


#include <bits/stdc++.h>

#define ll long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

const int N = 100005;
int n, m, s, f, t[N], l[N], r[N];

int main() {
	fastio
	cin >> n >> m >> s >> f;
	for (int i = 0; i < m; ++i) {
		cin >> t[i] >> l[i] >> r[i];
	}
	t[m] = -1;
	int timer = 0, pos = 0;
	string ans;
	while (s != f) {
		char ch = (s>f ? 'L' : 'R');
		++timer;
		if (t[pos] == timer) {
			int p1 = s, p2 = ch == 'L' ? s - 1 : s + 1;
			if (p1 >= l[pos] && p1 <= r[pos] ||
				p2 >= l[pos] && p2 <= r[pos]) {
				ch = 'X';
			}
			++pos;
		}
		ans += ch;
		if (ch == 'L') --s;
		else if (ch == 'R') ++s;
	}
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

int main(){
	fastio
	int n,m,s,f,nt = 0;
	cin >> n >> m >> s >> f;
	char tmp = (s > f ? 'L' : 'R');
	string ans = "";
	for(int i = 0;i < m;i++){
		int t, l, r;
		cin >> t >> l >> r;
		while(nt < t&&s!=f){
			nt++;
			if(nt==t){
				if(s>=l&&s<=r) ans += 'X';
				else if(s+(s>f?-1:1)>=l&&s+(s>f?-1:1)<=r) ans+='X';
				else s+=(s>f?-1:1), ans+=tmp;
			}else if(nt<t){
				s+=(s>f?-1:1),ans+=tmp;
			}
		}
	}
	cout << ans << "\n";
}


#include<bits/stdc++.h>
using namespace std;
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
string solve()
{
	int n,m,s,f;cin>>n>>m>>s>>f;
     int arr[m][3];
     int x=-1;
     if(f>s)
     	x=1;
     string ans="";
     for(int i=0;i<m;i++)
     {
     	cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
     	if(s!=f)
     	{
     		if(i!=0&&(arr[i][0]-arr[i-1][0]>1))
     	{
     		int z=arr[i][0]-arr[i-1][0]-1;
     		while(s!=f&&z--)
     		{
     			ans+=(x==-1)?'L':'R';
     			s+=x;
     		}
     	}
     	if(s!=f&&(arr[i][1]>s||s>arr[i][2])&&(arr[i][1]>s+x||s+x>arr[i][2]))
     	{
             ans+=(x==-1)?'L':'R';
             s=s+x;

     	}
     	else if(s!=f)
     	{
     		ans+='X';
     	}
     }

     }
     if(s!=f)
     {
     	while(s!=f)
     	{
     		 ans+=(x==-1)?'L':'R';
     		 s+=x;
     	}
     }
     return ans;
}
int32_t main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cout<<solve()<<'\n';
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
string solve()
{
	int n,m,s,f;cin>>n>>m>>s>>f;
     int arr[m][3];
     int x=-1;
     if(f>s)
     	x=1;
     string ans="";
     for(int i=0;i<m;i++)
     {
     	cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
     	if(s!=f)
     	{
     		if(i!=0&&(arr[i][0]-arr[i-1][0]>1))
     	{
     		int z=arr[i][0]-arr[i-1][0]-1;
     		while(s!=f&&z--)
     		{
     			ans+=(x==-1)?'L':'R';
     			s+=x;
     		}
     	}
     	if(s!=f&&(arr[i][1]>s||s>arr[i][2])&&(arr[i][1]>s+x||s+x>arr[i][2]))
     	{
             ans+=(x==-1)?'L':'R';
             s=s+x;

     	}
     	else if(s!=f)
     	{
     		ans+='X';
     	}
     }

     }
     if(s!=f)
     {
     	while(s!=f)
     	{
     		 ans+=(x==-1)?'L':'R';
     		 s++;
     	}
     }
     return ans;
}
int32_t main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cout<<solve()<<'\n';
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
string solve()
{
	int n,m,s,f;cin>>n>>m>>s>>f;
     int arr[m][3];
     int x=-1;
     if(f>s)
     	x=1;
     string ans="";
     for(int i=0;i<m;i++)
     {
     	cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
     	if(s!=f)
     	{
     		if((i!=0&&(arr[i][0]-arr[i-1][0]>1)))
     	{
     		int z=arr[i][0]-arr[i-1][0]-1;
     		while(s!=f&&z--)
     		{
     			ans+=(x==-1)?'L':'R';
     			s+=x;
     		}
     	}
     	if((i==0&&arr[i][0]-0>1))
     	{
     		int z=arr[0][0]-1;
     		while(s!=f&&z--)
     		{
     			ans+=(x==-1)?'L':'R';
     			s+=x;
     		}
     	}
     	if(s!=f&&(arr[i][1]>s||s>arr[i][2])&&(arr[i][1]>s+x||s+x>arr[i][2]))
     	{
             ans+=(x==-1)?'L':'R';
             s=s+x;

     	}
     	else if(s!=f)
     	{
     		ans+='X';
     	}
     }

     }
     if(s!=f)
     {
     	while(s!=f)
     	{
     		 ans+=(x==-1)?'L':'R';
     		 s+=x;
     	}
     }
     return ans;
}
int32_t main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cout<<solve()<<'\n';
    return 0;

}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pi 3.141592653589

ll power(ll b,ll e,ll m)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b%m,e/2,m)%m;
    return power(b*b%m,e/2,m);
}
ll power(ll b,ll e)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b,e/2);
    return power(b*b,e/2);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,s,f,t,l,r,x,count=0;
    cin>>n>>m>>s>>f;
    string str="";
    x=s;
    while(m--)
    {
        count++;
        cin>>t>>l>>r;
        if(count!=t)
        {
            while(t!=count)
            {
                count++;
                if(x==f)
                    continue;
                if(f>s)
                {
                    x++;
                    cout<<"R";
                }
                else
                {
                    x--;
                    cout<<"L";
                }
            }
        }
        if(count==t)
        {
            if(x==f)
                continue;
            if(f>s)
            {
                if((x+1<l) || x>r)
                {
                    x++;
                    cout<<"R";
                }else
                cout<<"X";
            }else
            {
                if(x<l || x-1>r)
                {
                    x--;
                    cout<<"L";
                }
                else
                    cout<<"X";
            }
        }
    }
    if(x!=f)
    {
        if(f>x)
        {
            for(auto i=0;i<f-x;i++)
                cout<<"R";
        }else
        {
            for(auto i=0;i<x-f;i--)
                cout<<"L";
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pi 3.141592653589

ll power(ll b,ll e,ll m)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b%m,e/2,m)%m;
    return power(b*b%m,e/2,m);
}
ll power(ll b,ll e)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b,e/2);
    return power(b*b,e/2);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,s,f,t,l,r,x,count=0;
    cin>>n>>m>>s>>f;
    string str="";
    x=s;
    while(m--)
    {
        count++;
        cin>>t>>l>>r;
        if(count!=t)
        {
            while(t!=count)
            {
                count++;
                if(x==f)
                    continue;
                if(f>s)
                {
                    x++;
                    str+="R";
                }
                else
                {
                    x--;
                    str+="L";
                }
            }
        }
        if(count==t)
        {
            if(x==f)
                continue;
            if(f>s)
            {
                if((x+1<l) || x>r)
                {
                    x++;
                    str+="R";
                }else
                str+="X";
            }else
            {
                if(x<l || x-1>r)
                {
                    x--;
                    str+="L";
                }
                else
                    str+="X";
            }
        }
    }
    cout<<str;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pi 3.141592653589

ll power(ll b,ll e,ll m)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b%m,e/2,m)%m;
    return power(b*b%m,e/2,m);
}
ll power(ll b,ll e)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b,e/2);
    return power(b*b,e/2);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,s,f,t,l,r,x,count=0;
    cin>>n>>m>>s>>f;
    string str="";
    x=s;
    while(m--)
    {
        count++;
        cin>>t>>l>>r;
        if(count!=t)
        {
            while(t!=count)
            {
                count++;
                if(x==f)
                    continue;
                if(f>s)
                {
                    x++;
                    str+="R";
                }
                else
                {
                    x--;
                    str+="L";
                }
            }
        }
        if(count==t)
        {
            if(x==f)
                continue;
            if(f>s)
            {
                if((x+1<l) || x>r)
                {
                    x++;
                    str+="R";
                }else
                str+="X";
            }else
            {
                if(x<l || x-1>r)
                {
                    x--;
                    str+="L";
                }
                else
                    str+="X";
            }
        }
    }
    if(x!=f)
    {
        if(f>x)
        {
            for(auto i=0;i<f-x;i++)
                str+="R";
        }else
        {
            for(auto i=0;i<x-f;i--)
                str+="L";
        }
    }
    cout<<str;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pi 3.141592653589

ll power(ll b,ll e,ll m)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b%m,e/2,m)%m;
    return power(b*b%m,e/2,m);
}
ll power(ll b,ll e)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b,e/2);
    return power(b*b,e/2);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m,s,f,t,l,r,x;
    cin>>n>>m>>s>>f;
    string str="";
    map<int,int> t1,l1,r1;
    while(m--)
    {
        cin>>t>>l>>r;
        t1[t]++;
        l1[t]=l;
        r1[t]=r;
    }
    x=s;
    if(f>s)
    {
        for(auto i=1;i<1000000000;i++)
        {
            if(x==f)
                break;
            else
            {
                if(t1[i]==1)
                {
                    if(x+1<l1[i] || x>r1[i])
                    {
                        x++;
                        cout<<"R";
                    }else
                    cout<<"X";
                }else
                {
                    x++;
                    cout<<"R";
                }
            }
        }
    }else
    {
       for(auto i=1;i<1000000000;i++)
        {
            if(x==f)
                break;
            else
            {
                if(t1[i]==1)
                {
                    if(x<l1[i] || x-1>r1[i])
                    {
                        x--;
                        cout<<"L";
                    }else
                    cout<<"X";
                }else
                {
                    x--;
                    cout<<"L";
                }
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll long long
int main()
{
    ll n,m,s,f,t,l,r;
    cin >> n >> m >> s >> f;

    vector<pair<ll,ll>> v(100005, {-1,-1});
    for(int i = 1; i <= m; ++i) {
        cin >> t >> l >> r;
        v[t] = {l,r};
    }

    ll left = 0, right = 0, cnt = 0;
    if(s > f) left = 1;
    else right = 1;

    string res = "";
    for(int i = 1; i <= 100000; ++i) {
        l = v[i].first;
        r = v[i].second;

        if(right) {
            if( (s+1 >= l && s+1 <= r) || (s >= l && s <= r) )
                res += "X";
            else s++, cnt++, res += "R";
        }
        else if(left) {
            if( (s-1 >= l && s-1 <= r) || (s >= l && s <= r) )
                res += "X";
            else s--, cnt++, res += "L";
        }
        if(s == f) break;
    }
    cout << res << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll long long
int main()
{
    ll n,m,s,f,t,l,r;
    cin >> n >> m >> s >> f;

    vector<pair<ll,pair<ll,ll>>> v(m+1);
    for(int i = 1; i <= m; ++i) {
        cin >> t >> l >> r;
        v[i] = {t,{l,r}};
    }

    sort(v.begin()+1, v.end());

    ll left = 0, right = 0, cnt = 0;
    if(s > f) left = 1;
    else right = 1;

    vector<char> res;
    for(int i = 1; i <= m; ++i) {
        t = v[i].first;
        l = v[i].second.first;
        r = v[i].second.second;

        if(t != i) {

            if(right) {
                if(s + t - i > f) {

                    for(int j = 0; j < (f-s); ++j)
                        res.push_back('R');

                    cnt += (f - s), s += (f - s);
                }
                else {

                    for(int j = 0; j < (t-i); ++j)
                        res.push_back('R');

                    s += (t - i); cnt += (t - i);
                }
            }
            else {
                if(s - t + i < f) {

                    for(int j = 0; j < (s-f); ++j)
                        res.push_back('L');

                    cnt += (s - f);
                    s -= (s - f);
                }
                else {

                    for(int j = 0; j < (t-i); ++j)
                        res.push_back('L');

                    s -= (-t + i);
                    cnt += (t - i);
                }
            }
        }
        else {
            if(right) {
                if(s+1 >= l && s+1 <= r) res.push_back('X');
                else s++, cnt++, res.push_back('R');
            }
            else {
                if(s-1 >= l && s-1 <= r) res.push_back('X');
                else s++, cnt++, res.push_back('L');
            }
        }
        if(s == f) break;
    }
    for(auto i : res)
        cout << i;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll long long
int main()
{
    ll n,m,s,f,t,l,r;
    cin >> n >> m >> s >> f;

    map<ll,pair<ll,ll>> mp;
    for(int i = 1; i <= m; ++i) {
        cin >> t >> l >> r;
        mp[t] = {l,r};
    }

    string res = "";
    for(int i = 1 ;; ++i) {
        l = mp[i].first;
        r = mp[i].second;

        if(s == f) break;

        if(s < f) {
            if( (s+1 >= l && s+1 <= r) || (s >= l && s <= r) )
                res += "X";
            else s++, res += "R";
        }
        else {
            if( (s-1 >= l && s-1 <= r) || (s >= l && s <= r) )
                res += "X";
            else s--, res += "L";
        }

    }
    cout << res << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 100 * 1000 + 10;
int n, m, s, f;
pair<int , pair<int, int>> a[N];
char out[2] = {'L', 'R'};

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> m >> s >> f;
	for (int i = 0; i < m; i++)
		cin >> a[i].first >> a[i].second.first >> a[i].second.second;
	int t = 0, less = (s < f? 1: -1), i = 0;
	while (s != f && ++t) {
		if (t == a[i].first && ((s >= a[i].second.first && s <= a[i].second.second) || (s + less >= a[i].second.first && s + less <= a[i].second.second)))
			cout << 'X';
		else
			s += less, cout << out[max(less, 0)];
		i++;
	}
	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 100 * 1000 + 10;
int n, m, s, f;
pair<int , pair<int, int>> a[N];
char out[2] = {'L', 'R'};

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> m >> s >> f;
	for (int i = 0; i < m; i++)
		cin >> a[i].first >> a[i].second.first >> a[i].second.second;
	int t = 1, less = (s < f? 1: -1), i = 0;
	while (s != f) {
		if (t == a[i].first && ((s >= a[i].second.first && s <= a[i].second.second) || (s + less >= a[i].second.first && s + less <= a[i].second.second)))
			cout << 'X', i++;
		else
			s += less, cout << out[max(less, 0)];
		t++;
	}
	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 100 * 1000 + 10;
int n, m, s, f;
pair<int, int> a[N];
char out[2] = {'L', 'R'};

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> m >> s >> f;
	for (int i = 0; i < m; i++) {
		int t;
		cin >> t >> a[t].first >> a[t].second;
	}
	int t = 0, less = (s < f? 1: -1);
	while (s != f && ++t)
		if ((t < m) && (s >= a[t].first && s <= a[t].second) || (s + less >= a[t].first && s + less <= a[t].second))
			cout << 'X';
		else
			s += less, cout << out[max(less, 0)];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 100 * 1000 + 10;
int n, m, s, f;
pair<int, int> a[N];
char out[2] = {'L', 'R'};

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> m >> s >> f;
	for (int i = 0; i < m; i++) {
		int t;
		cin >> t >> a[t].first >> a[t].second;
	}
	int t = 0, less = (s < f? 1: -1);
	while (s != f && ++t)
		if ((s >= a[t].first && s <= a[t].second) || (s + less >= a[t].first && s + less <= a[t].second))
			cout << 'X';
		else
			s += less, cout << out[max(less, 0)];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 100 * 1000 + 10;
int n, m, s, f;
pair<int , pair<int, int>> a[N];
char out[2] = {'L', 'R'};

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> m >> s >> f;
	for (int i = 0; i < m; i++)
		cin >> a[i].first >> a[i].second.first >> a[i].second.second;
	int t = 1, less = (s < f? 1: -1), i = 0;
	while (s != f) {
		if (t == a[i].first && ((s >= a[i].second.first && s <= a[i].second.second) || (s + less >= a[i].second.first && s + less <= a[i].second.second)))
			cout << 'X', i++;
		else {
			if (t == a[i].first)
				i++;
			s += less, cout << out[max(less, 0)];
		}
		t++;
	}
	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
typedef long long ll;
const int INF = 1<<29;
const int N = 1e3 + 9;
int a[N][N], b[N][N];
bool cmp(const pair<ll, ll> &a, const pair<ll, ll> &b)
{
    if(a.second == b.second){
        return a.first < b.first;
    }
    return a.second < b.second;
}
int main()
{
    fio;
    string ans;
    ll n, m, s, t, a, b, c;
    cin >> n >> m >> s >> t;
    map <ll, ll> l, r;
    for(int i = 0; i < m; i ++)
    {
        cin >> a >> b >> c;
        l[a] = b;
        r[a] = c;
    }
    for(int i = 1; ; i ++)
    {
        if(s == t) break;
        else if(s < t)
        {
            if(s + 1 >= l[i] && s <= r[i]){
                ans += 'X';
            }
            else {
                ans += 'R';
                s ++;
            }
        }
        else{
            if(s - 1 <= r[i] && s >= l[i]){
                ans += 'X';
            }
            else{
                ans += 'L';
                s --;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
typedef long long ll;
const int INF = 1<<29;
const int N = 1e3 + 9;
int a[N][N], b[N][N];
bool cmp(const pair<ll, ll> &a, const pair<ll, ll> &b)
{
    if(a.second == b.second){
        return a.first < b.first;
    }
    return a.second < b.second;
}
int main()
{
    fio;
    string ans;
    ll n, m, s, t, a, b, c, k = -1;
    cin >> n >> m >> s >> t;
    ll ini = s, prev = 0;
    if(s > t) k = 1;
    else k = 0;
    for(int i = 0; i < m; i ++)
    {
        cin >> a >> b >> c;

        if(ini == t){continue;}
        if(k == 0)
        {
            if(a != prev + 1){
                if(abs(a - prev) >= abs(ini - t)){
                    for(int j = 0; j < abs(ini - t); j ++){
                        ans += 'R';
                    }
                }
            }
            else{
                if(ini + 1 >= b && ini + 1 <= c){
                    ans += 'X';
                }
                else{
                    ini ++;
                    ans += 'R';
                }
            }
        }
        else
        {
            if(a != prev + 1){
                if(abs(a - prev) >= abs(ini - t)){
                    for(int j = 0; j < abs(ini - t); j ++){
                        ans += 'L';
                    }
                }
            }
            else{
                if(ini - 1 <= c & ini - 1>= b){
                    ans += 'X';
                }
                else{
                    ini --;
                    ans += 'L';
                }
            }
        }
        prev = a;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
typedef long long ll;
const int INF = 1<<29;
const int N = 1e3 + 9;
int a[N][N], b[N][N];
bool cmp(const pair<ll, ll> &a, const pair<ll, ll> &b)
{
    if(a.second == b.second){
        return a.first < b.first;
    }
    return a.second < b.second;
}
int main()
{
    fio;
    string ans;
    ll n, m, s, t, a, b, c, k = -1;
    cin >> n >> m >> s >> t;
    ll ini = s;
    if(s > t) k = 1;
    else k = 0;
    for(int i = 0; i < m; i ++)
    {
        cin >> a >> b >> c;
        if(ini == t){continue;}
        if(ini + 1 >= b && ini + 1 <= c){
            ans += 'X';
            continue;
        }
        else{
            if(k == 1){
               ini --;
               ans += 'L';
            }
            else{
                ini ++;
                ans += 'R';
            }
        }
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
typedef long long ll;
const int INF = 1<<29;
const int N = 1e3 + 9;
int a[N][N], b[N][N];
bool cmp(const pair<ll, ll> &a, const pair<ll, ll> &b)
{
    if(a.second == b.second){
        return a.first < b.first;
    }
    return a.second < b.second;
}
int main()
{
    fio;
    string ans;
    ll n, m, s, t, a, b, c, k = -1;
    cin >> n >> m >> s >> t;
    ll ini = s, prev = 0;
    if(s > t) k = 1;
    else k = 0;
    for(int i = 0; i < m; i ++)
    {
        cin >> a >> b >> c;
        if(ini == t){continue;}
        if(k == 0)
        {
            if(a != prev + 1){
                if(abs(a - prev) >= abs(ini - t)){ //cout << abs(a-prev) << " " << abs(ini-t) << " " << ans << " " << ini << endl;
                    for(int j = 0; j <= abs(ini - t); j ++){
                        ans += 'R';
                        ini ++;
                    }
                   // cout << ini << endl;
                }
                else{
                    for(int j = 0; j <= abs(a - prev); j ++){
                        ans += 'R';
                        ini ++;
                    }
                }
            }
            else{
                if((ini + 1 >= b && ini + 1 <= c) || (ini >= b && ini <= c)){
                    ans += 'X';
                }
                else{
                    ini ++;
                    ans += 'R';
                }
            }
        }
        else
        {
            if(a != prev + 1){
                if(abs(a - prev) >= abs(ini - t)){
                    for(int j = 0; j <= abs(ini - t); j ++){
                        ans += 'L';
                        ini --;
                    }
                }
                else{
                    for(int j = 0; j <= abs(a - prev); j ++){
                        ans += 'L';
                        ini --;
                    }
                }
            }
            else{
                if((ini - 1 <= c & ini - 1 >= b) || (ini <= c & ini >= b)){
                    ans += 'X';
                }
                else{
                    ini --;
                    ans += 'L';
                }
            }
        }
        prev = a;
        //cout << ini << endl;
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long ll;
typedef double dd;
#define pb push_back
#define mp make_pair
#define endl "\n"
ll const M = 1000000007;
dd const pi = acos(-1);
ll const inf = 9e18;
ll const N = 200001;
struct input
{
	ll t,l,r;
};
int main()
{
    fast;
  	ll i,j,t,n,m,s,f,l,r,curr,step = 1,assign;
  	cin >> n >> m >> s >> f;
  	curr = s;
  	vector<input> v;
  	vector<ll> a;
  	for(i = 0; i < m; i++)
  	{
  		cin >> t >> l >> r;
  		v.pb({t,l,r});
  	}
  	char put;
  	if(s <= f)
  		put = 'R',assign = 1;
  	else
  		put = 'L',assign = -1;
  	i = 0;
  	while(curr != f)
  	{
  		if(((curr >= v[i].l && curr <= v[i].r) || (curr + assign >= v[i].l && curr + assign <= v[i].r)) && v[i].t == step)
  			a.pb(0);
  		else
  			a.pb(1),curr += assign;
  		while(v[i].t <= step && i != m)
  			i++;
  		step++;
  		if(i == m)
  			break;
  	}
  	while(curr != f)
  	{
  		a.pb(1);
  		curr += assign;
  	}
  	for(i = 0; i < (ll)a.size(); i++)
  	{
  		if(a[i])
  			cout<<put;
  		else
  			cout<<'X';
  	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long ll;
typedef double dd;
#define pb push_back
#define mp make_pair
#define endl "\n"
ll const M = 1000000007;
dd const pi = acos(-1);
ll const inf = 9e18;
ll const N = 200001;
struct input
{
	ll t,l,r;
};
int main()
{
    fast;
  	ll i,j,t,n,m,s,f,l,r,curr,step = 1,assign;
  	cin >> n >> m >> s >> f;
  	curr = s;
  	vector<input> v;
  	vector<ll> a;
  	for(i = 0; i < m; i++)
  	{
  		cin >> t >> l >> r;
  		v.pb({t,l,r});
  	}
  	char put;
  	if(s <= f)
  		put = 'R',assign = 1;
  	else
  		put = 'L',assign = -1;
  	i = 0;
  	while(curr != f)
  	{
  		if(((curr >= v[i].l && curr <= v[i].r) || (curr + assign >= v[i].l && curr + assign <= v[i].r)) && v[i].t == step)
  			a.pb(0);
  		else
  			a.pb(1),curr += assign;
  		while(v[i].t <= step)
  			i++;
  		step++;
  		if(i == m)
  			break;
  	}
  	while(curr != f)
  	{
  		a.pb(1);
  		curr += assign;
  	}
  	for(i = 0; i < (ll)a.size(); i++)
  	{
  		if(a[i])
  			cout<<put;
  		else
  			cout<<'X';
  	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long ll;
typedef double dd;
#define pb push_back
#define mp make_pair
#define endl "\n"
ll const M = 1000000007;
dd const pi = acos(-1);
ll const inf = 9e18;
ll const N = 200001;
int main()
{
    fast;
  	ll i,j,t,n,m,s,f,l,r,curr,step = 1,assign;
  	cin >> n >> m >> s >> f;
  	curr = s;
  	vector<ll> v;
  	char put;
  	if(s <= f)
  		put = 'R',assign = 1;
  	else
  		put = 'L',assign = -1;
  	for(i = 1; i <= m; i++)
  	{
  		cin >> t >> l >> r;
  		if(((curr >= l && curr <= r) || (curr + assign >= l && curr + assign <= r)) && t == step)
  			v.pb(0);
  		else
  			v.pb(1),curr += assign;
  		step++;
  		if(curr == f)
  			break;
  	}
  	for(i = 0; i < (ll)v.size(); i++)
  	{
  		if(v[i])
  			cout<<put;
  		else
  			cout<<'X';
  	}
    return 0;
}


#include <bits/stdc++.h>
#define int long long
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rep(i,a,n) for(int i=a;i<n;i++)
#define N 7200001
#define M 1000000007
using namespace std;
signed main(){
int n,m,s,f;
cin>>n>>m>>s>>f;
std::vector<pair<int,pair<int,int>>> v(m);
rep(i,0,m) cin>>v[i].fr>>v[i].sc.fr>>v[i].sc.sc;
sort(all(v));
int max = v[m-1].fr;
vector<pair<int,pair<int,int>>> v1(max);
rep(i,0,max){
  v1.pb(mp(i+1,mp(-1,-1)));
}

rep(i,0,m){
  v1[v[i].fr-1].sc.fr=v[i].sc.fr;
  v1[v[i].fr-1].sc.sc=v[i].sc.sc;
}
rep(i,0,max) cout<<v1[i].fr<<" "<<v1[i].sc.fr<<" "<<v1[i].sc.sc<<endl;
if(f>s){
  rep(i,0,max){
    if(s+1>=v1[i].sc.fr && s+1<=v1[i].sc.sc ) cout<<"X";
    else {s++;cout<<"R";}
    if(s==f) break;
  }
}
else{
  rep(i,0,max){
    if(s-1>=v1[i].sc.fr && s-1<=v1[i].sc.sc) cout<<"X";
    else {s--;cout<<"L";}
    if(s==f) break;
  }
}
}


#include <bits/stdc++.h>
#define int long long
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rep(i,a,n) for(int i=a;i<n;i++)
#define N 7200001
#define M 1000000007
using namespace std;
signed main(){
int n,m,s,f;
cin>>n>>m>>s>>f;
std::vector<pair<int,pair<int,int>>> v(m);
rep(i,0,m) cin>>v[i].fr>>v[i].sc.fr>>v[i].sc.sc;
sort(all(v));
if(f>s){
  rep(i,0,m){
    if(s+1>=v[i].sc.fr && s+1<=v[i].sc.sc) cout<<"X";
    else {s++;cout<<"R";}
    if(s==f) break;
  }
}
else{
  rep(i,0,m){
    if(s-1>=v[i].sc.fr && s-1<=v[i].sc.sc) cout<<"X";
    else {s--;cout<<"L";}
    if(s==f) break;
  }
}
}


#include <bits/stdc++.h>
#define int long long
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rep(i,a,n) for(int i=a;i<n;i++)
#define N 7200001
#define M 1000000007
using namespace std;
signed main(){
int n,m,s,f;
cin>>n>>m>>s>>f;
std::vector<pair<int,pair<int,int>>> v(m);
rep(i,0,m) cin>>v[i].fr>>v[i].sc.fr>>v[i].sc.sc;
sort(all(v));
int max = v[m-1].fr;
vector<pair<int,pair<int,int>>> v1(max);
rep(i,0,max){
  v1.pb(mp(i+1,mp(-1,-1)));
}

rep(i,0,m){
  v1[v[i].fr-1].sc.fr=v[i].sc.fr;
  v1[v[i].fr-1].sc.sc=v[i].sc.sc;
}
//rep(i,0,max) cout<<v1[i].fr<<" "<<v1[i].sc.fr<<" "<<v1[i].sc.sc<<endl;
if(f>s){
  rep(i,0,max){
    if(s+1>=v1[i].sc.fr && s+1<=v1[i].sc.sc ) cout<<"X";
    else {s++;cout<<"R";}
    if(s==f) break;
  }
}
else{
  rep(i,0,max){
    if(s-1>=v1[i].sc.fr && s-1<=v1[i].sc.sc) cout<<"X";
    else {s--;cout<<"L";}
    if(s==f) break;
  }
}
}


#include <bits/stdc++.h>
#define int long long
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rep(i,a,n) for(int i=a;i<n;i++)
#define N 7200001
#define M 1000000007
using namespace std;
signed main(){
int n,m,s,f;
cin>>n>>m>>s>>f;
std::vector<pair<int,pair<int,int>>> v;
v.pb(mp(0,mp(0,0)));
rep(i,1,m+1){
  int a,b,c;
  cin>>a>>b>>c;
  v.pb(mp(a,mp(b,c)));
}
sort(all(v));

//rep(i,0,m+1) cout<<v[i].fr<<" "<<v[i].sc.fr<<" "<<v[i].sc.sc<<endl;
if(f>s){
  rep(i,0,m+1){
    if(v[i+1].fr-v[i].fr==1 && i!=m){
      if(i){
    if((s+1>=v[i].sc.fr && s+1<=v[i].sc.sc) || (s>=v[i].sc.fr && s<=v[i].sc.sc) ) cout<<"X";
    else {s++;cout<<"R";}
    if(s==f) break;
  }

  }
  else {
    if((s+1>=v[i].sc.fr && s+1<=v[i].sc.sc) || (s>=v[i].sc.fr && s<=v[i].sc.sc) ) cout<<"X";
    int x = (v[i+1].fr-v[i].fr)-1;
    while(x--)
    {
      cout<<"R";s++;if(s==f) break;
    }
    if(s==f) break;
  }
}
  if(s!=f) {rep(i,0,f-s)cout<<"R";}
}
else{
  rep(i,0,m+1){
    if(v[i+1].fr-v[i].fr==1 &&i!=m){
    if(i){
    if((s-1>=v[i].sc.fr && s-1<=v[i].sc.sc) || (s>=v[i].sc.fr && s<=v[i].sc.sc)) cout<<"X";

    else {s--;cout<<"L";}
    if(s==f) break;
  }

  }
  else{
      if((s-1>=v[i].sc.fr && s-1<=v[i].sc.sc) || (s>=v[i].sc.fr && s<=v[i].sc.sc)) cout<<"X";
    int x =(v[i+1].fr-v[i].fr)-1;
        // cout<<"ca ca "<<endl;
    while(x--)
    {
      cout<<"L";s--;if(s==f) break;
    }
    if(s==f) break;
  }
}
  if(s!=f) {rep(i,0,s-f)cout<<"L";}
}
}


#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<functional>
#include<map>
#include<math.h>
using namespace std;
#define int long long
typedef vector<int> vi;
typedef pair<int,int> pi;
#define pb push_back
#define mp make_pair
#define fr(i,s,e) for(int i=s; i<e; i++)
#define rf(i,s,e) for(int i=e; i>s; i--)
#define vfr(it, g1)  for (auto it = g1.begin(); it != g1.end(); it++)
#define pp pop_back
#define bs binary_search
#define ins insert
#define ln length
#define vsort(a) sort(a.begin(), a.end())
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rea(a,n)  for(int i=0; i<n; i++) cin>>a[i]
#define pra(a,n)  for(int i=0;i<n;i++) cout<<a[i]<<" "
#define lb lower_bound
#define ub upper_bound
#define lss bool operator < (const class_name& rhs) const {return object<rhs.object;}
#define grtr bool operator < (const class_name& rhs) const {return object>rhs.object;}
int32_t main()
{
    IOS;
    int n,m,s,f;
    cin>>n>>m>>s>>f;
    int a[m],b[m],c[m];
    fr(i,0,m)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    int d = s;
    int k=0;
    while(b[k]<=c[k])
    {
        if(d==b[k-1] || d == b[k] && (d==b[k+1] || d == b[k]))
        cout<<"X";
        else
        {
            if(d<f)
            {cout<<"R";
            d++;
            }
            else
            {
                cout<<"L";
                d--;
            }

        }
        k++;
        if(d==f)
        return 0;
    }
}


#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<functional>
#include<map>
#include<math.h>
using namespace std;
#define int long long
typedef vector<int> vi;
typedef pair<int,int> pi;
#define pb push_back
#define mp make_pair
#define fr(i,s,e) for(int i=s; i<e; i++)
#define rf(i,s,e) for(int i=e; i>s; i--)
#define vfr(it, g1)  for (auto it = g1.begin(); it != g1.end(); it++)
#define pp pop_back
#define bs binary_search
#define ins insert
#define ln length
#define vsort(a) sort(a.begin(), a.end())
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rea(a,n)  for(int i=0; i<n; i++) cin>>a[i]
#define pra(a,n)  for(int i=0;i<n;i++) cout<<a[i]<<" "
#define lb lower_bound
#define ub upper_bound
#define lss bool operator < (const class_name& rhs) const {return object<rhs.object;}
#define grtr bool operator < (const class_name& rhs) const {return object>rhs.object;}
int32_t main()
{
    IOS;
    int n,m,s,f;
    cin>>n>>m>>s>>f;
    int a[m],b[m],c[m];
    fr(i,0,m)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    int d = s;
    int k=0;
    while(b[k]<=c[k])
    {
        if(k!= 0 || k!= m-1)
        {
        if(d==b[k-1] || d == b[k] && (d==b[k+1] || d == b[k]))
        cout<<"X";
         else
        {
            if(d<f)
            {cout<<"R";
            d++;
            }
            else
            {
                cout<<"L";
                d--;
            }

        }
        }
        else if(k==0)
        {
            if(d == b[k+1] || d == b[k])
            cout<<"X";
             else
            {
            if(d<f)
            {cout<<"R";
            d++;
            }
            else
            {
                cout<<"L";
                d--;
            }

            }
        }
        else if(k==m-1)
        {
            if(d == b[k] || d == b[k-1])
            cout<<"X";
            else
            {
                if(d<f)
                {cout<<"R";
                d++;
                 }
                 else
                 {
                cout<<"L";
                d--;
                 }
            }

        }
        k++;
        if(d==f)
        return 0;
    }
}


#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<functional>
#include<map>
#include<math.h>
using namespace std;
#define int long long
typedef vector<int> vi;
typedef pair<int,int> pi;
#define pb push_back
#define mp make_pair
#define fr(i,s,e) for(int i=s; i<e; i++)
#define rf(i,s,e) for(int i=e; i>s; i--)
#define vfr(it, g1)  for (auto it = g1.begin(); it != g1.end(); it++)
#define pp pop_back
#define bs binary_search
#define ins insert
#define ln length
#define vsort(a) sort(a.begin(), a.end())
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rea(a,n)  for(int i=0; i<n; i++) cin>>a[i]
#define pra(a,n)  for(int i=0;i<n;i++) cout<<a[i]<<" "
#define lb lower_bound
#define ub upper_bound
#define lss bool operator < (const class_name& rhs) const {return object<rhs.object;}
#define grtr bool operator < (const class_name& rhs) const {return object>rhs.object;}
int32_t main()
{
    IOS;
    int n,m,s,f,d,t=1;
	char k;
    cin>>n>>m>>s>>f;
    d=(f>s? 1 :-1 );
    k =(f>s?'R':'L');
    for(int x=1; x<=m; x++){
        int a,b,c;
		cin>>a>>b>>c;
        if(s==f)
			break;
        while(t<a && s!=f){
			cout<<k; s+=d; t++;
		}
        if(s==f)
			break;
        else if((s>=b&&s<=c) || (s+d>=b&&s+d<=c)){
			cout<<'X';t++;
		}
        else{
			cout<<k; s+=d;t++;
		}
    }
    while(s!=f){
		cout<<k;
		s+=d;
	}

}


#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<functional>
#include<map>
#include<math.h>
using namespace std;
#define int long long
typedef vector<int> vi;
typedef pair<int,int> pi;
#define pb push_back
#define mp make_pair
#define fr(i,s,e) for(int i=s; i<e; i++)
#define rf(i,s,e) for(int i=e; i>s; i--)
#define vfr(it, g1)  for (auto it = g1.begin(); it != g1.end(); it++)
#define pp pop_back
#define bs binary_search
#define ins insert
#define ln length
#define vsort(a) sort(a.begin(), a.end())
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rea(a,n)  for(int i=0; i<n; i++) cin>>a[i]
#define pra(a,n)  for(int i=0;i<n;i++) cout<<a[i]<<" "
#define lb lower_bound
#define ub upper_bound
#define lss bool operator < (const class_name& rhs) const {return object<rhs.object;}
#define grtr bool operator < (const class_name& rhs) const {return object>rhs.object;}
int32_t main()
{
    IOS;
    int n,m,s,f;
    cin>>n>>m>>s>>f;
    int a[m],b[m],c[m];
    fr(i,0,m)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    int d = s;
    int k=0;
    while(b[k]<=c[k])
    {
        if(k!= 0 && k!= m-1)
        {
        if(d==b[k-1] || d == b[k] && (d==b[k+1] || d == b[k]))
        cout<<"X";
         else
        {
            if(d<f)
            {cout<<"R";
            d++;
            }
            else
            {
                cout<<"L";
                d--;
            }

        }
        }
        else if(k==0)
        {
            if(d == b[k+1] || d == b[k])
            cout<<"X";
             else
            {
            if(d<f)
            {cout<<"R";
            d++;
            }
            else
            {
                cout<<"L";
                d--;
            }

            }
        }
        else if(k==m-1)
        {
            if(d == b[k] || d == b[k-1])
            cout<<"X";
            else
            {
                if(d<f)
                {cout<<"R";
                d++;
                 }
                 else
                 {
                cout<<"L";
                d--;
                 }
            }

        }
        k++;
        if(d==f)
        return 0;
    }
}


/*
Mohit Dhattarwal
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,ll> psl;
typedef pair<ll,string> pls;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;

void solve()
{
	ll n,m,s,f;
	cin>>n>>m>>s>>f;
	string ans = "";
	ll count = abs(s-f);
	ll posn = s;
	if(s>f)
	{
		ll t,l,r;
		for(ll i =0; i<m; i++)
		{
			cin>>t>>l>>r;
			ll num = ans.length();
			if(count>0)
			{
				if(t>num+1)
				{
					for(ll j=0; j<(t-num+1) && count>0; j++)
					{
						ans+="L";
						count--;
						posn--;
					}
				}
				else if(t==num+1)
				{
					if(posn<l-1 || posn>r)
					{
						ans+="L";
						count--;
						posn--;
					}
				}
				else
				{
					ans+="X";
				}
			}
		}
	}
	else if(f>s)
	{
		ll t,l,r;
		for(ll i =0; i<m; i++)
		{
			cin>>t>>l>>r;
			ll num = ans.length();
			//tr(t,num,posn,count);
			if(count>0)
			{
				if(t>num+1)
				{
					for(ll j=0; j<(t-num+1) && count>0; j++)
					{
						ans+="R";
						count--;
						posn++;
					}
				}
				else if(t==num+1)
				{
					if(posn<l-1 || posn>r)
					{
						//tr(posn,l,r);
						ans+="R";
						count--;
						posn++;
					}
					else
					{
						ans+="X";
					}
				}
			}
		}
	}
	cout<<ans<<'\n';
}

int main(){
	fastio();
	ll t;
	t=1;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*
Mohit Dhattarwal
*/
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<string,ll> psl;
typedef pair<ll,string> pls;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;

void solve()
{
	ll n,m,s,f;
	cin>>n>>m>>s>>f;
	string ans = "";
	ll count = abs(s-f);
	ll posn = s;
	if(s>f)
	{
		ll t,l,r;
		for(ll i =0; i<m; i++)
		{
			cin>>t>>l>>r;
			ll num = ans.length();
			if(count>0)
			{
				if(t>num+1)
				{
					for(ll j=0; j<(t-num+1) && count>0; j++)
					{
						ans+="L";
						count--;
						posn--;
					}
				}
				else if(t==num+1)
				{
					//tr(posn,l,r,posn<l,posn>r+1);
					if(posn<l || posn>r+1)
					{
						//tr(posn,l,r);
						ans+="L";
						count--;
						posn--;
					}
					else
					{
						ans+="X";
					}
				}

			}
		}
	}
	else if(f>s)
	{
		ll t,l,r;
		for(ll i =0; i<m; i++)
		{
			cin>>t>>l>>r;
			ll num = ans.length();
			//tr(t,num,posn,count);
			if(count>0)
			{
				if(t>num+1)
				{
					for(ll j=0; j<(t-num+1) && count>0; j++)
					{
						ans+="R";
						count--;
						posn++;
					}
				}
				else if(t==num+1)
				{
					if(posn<l-1 || posn>r)
					{
						//tr(posn,l,r);
						ans+="R";
						count--;
						posn++;
					}
					else
					{
						ans+="X";
					}
				}
			}
		}
	}
	cout<<ans<<'\n';
}

int main(){
	fastio();
	ll t;
	t=1;
	while(t--)
	{
		solve();
	}
	return 0;
}