/*
 ~/BAU/ACM-ICPC/Teams/Rampage/MMZA
 ~/sudo apt-get verdict Accepted
 practice...
*/
//package javaapplication1;

//import java.util.Scanner;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static final int Mod=(int)1e9+7;
    static final int N=(int)2e5+5;
    public static void main(String[] args) throws IOException {
       // Reader.init(System.in);
        //Scanner in=new Scanner(new FileInputStream("input.txt"));
        FastReader in=new FastReader();
        StringBuilder sb=new StringBuilder();
        //in=new FileReader("input.txt");
        //PrintWriter out=new PrintWriter(new FileOutputStream("output.txt"));
        PrintWriter out=new PrintWriter(System.out);
        Main ob=new Main();
        int n=in.nextInt(),m=in.nextInt(),s=in.nextInt(),f=in.nextInt(),last=0;
        if(s==f){
            out.println("X");
            out.close();
            return;
        }
        String res="";
        for(int i=1;i<=m&&s!=f;i++){

            int t=in.nextInt();
            int l=in.nextInt();
            int r=in.nextInt();

            while(last+1<t&&s!=f){
                if(s<f){
                    res+='R';
                    s++;
                }
                else if(s>f){
                    res+='L';
                    s--;
                }
                last++;
            }
            last=t;

            if(s==f)
                break;

            if(s>=l&&s<=r){
                res+='X';
                continue;
            }

            if(s<f){
                if(s+1>=l&&s+1<=r)
                    res+='X';
                else{
                    res+='R';
                    s++;
                }
            }
            else {
                if(s-1>=l&&s-1<=r)
                    res+='X';
                else{
                    res+='L';
                    s--;
                }
            }
        }
        out.println(res);
        out.close();
    }

    static int[] reverse(int [] arr){
        ArrayList<Integer> temp=new ArrayList();
        for(int i=0;i<arr.length;i++)
            temp.add(arr[i]);
        Collections.reverse(temp);
        for(int i=0;i<temp.size();i++)
            arr[i]=temp.get(i);
        return arr;
    }
    static String reverse(String s){
        String temp="";
        for(int i=s.length()-1;i>=0;i--)
            temp+=s.charAt(i);
        return temp;
    }
    static String sort(String inputString)
    {
        ArrayList<Character> arr=new ArrayList();
        for(int i=0;i<inputString.length();i++)
            arr.add(inputString.charAt(i));
        Collections.sort(arr);
        StringBuilder sb=new StringBuilder();
        for(int i=0;i<arr.size();i++)
            sb.append(arr.get(i));

        return sb.toString();
    }

    static boolean next_permutation(int[] p, int len) {
        int a = len - 2;
        while (a >= 0 && p[a] >= p[a + 1]) {
            a--;
        }

        if (a == -1) {
            return false;
        }

        int b = len - 1;
        while (p[b] <= p[a]) {
            b--;
        }

        p[a] += p[b];
        p[b] = p[a] - p[b];
        p[a] -= p[b];

        for (int i = a + 1, j = len - 1; i < j; i++, j--) {
            p[i] += p[j];
            p[j] = p[i] - p[j];
            p[i] -= p[j];
        }

        return true;
    }
    static int lower_bound(ArrayList<Integer> arr,int key) {
        int len = arr.size();
        int lo = 0;
        int hi = len-1;
        int mid = (lo + hi)/2;
        while (true) {
            int cmp = (arr.get(mid)==key?1:0);
            if (cmp == 0 || cmp > 0) {
                hi = mid-1;
                if (hi < lo)
                    return mid;
            } else {
                lo = mid+1;
                if (hi < lo)
                    return mid<len-1?mid+1:-1;
            }
            mid = (lo + hi)/2;
        }
    }
    static int upper_bound(ArrayList<Integer> arr, int key) {
        int len = arr.size();
        int lo = 0;
        int hi = len-1;
        int mid = (lo + hi)/2;
        while (true) {
            int cmp = (arr.get(mid)==key?1:0);
            if (cmp == 0 || cmp < 0) {
                lo = mid+1;
                if (hi < lo)
                    return mid<len-1?mid+1:-1;
            } else {
                hi = mid-1;
                if (hi < lo)
                    return mid;
            }
            mid = (lo + hi)/2;
        }
    }
    static int gcd(int a,int b){
        return b==0?a:gcd(b,a%b);
    }
    static double dot(Point p,Point q){
        return (p.x*q.x+p.y*q.y);
    }
    static double cross(Point p,Point q){
        return (p.x*q.y-p.y*q.x);
    }
    static Point computeLineIntersection(Point a,Point b,Point c,Point d){
        b=b.sub(a);d=c.sub(d);c=c.sub(a);
        return a.add(b.mulCon(cross(c,d)).devideCon(cross(b,d)));
    }
   static class FastReader
        {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}
class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(
                new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    static void init(String url) throws FileNotFoundException {
        reader = new BufferedReader(new FileReader(url));
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static String nextLine() throws IOException {
        return reader.readLine();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}
class Point{
    double x,y;
    Point(double _x,double _y){
        x=_x;
        y=_y;
    }
    Point add(final Point p){
        return new Point(x+p.x,y+p.y);
    }
    Point sub(final Point p){
        return new Point(x-p.x,y-p.y);
    }
    Point mulCon(final double c){
        return new Point(c*x,c*y);
    }
    Point devideCon(final double c){
        return new Point(x/c,y/c);
    }
}
class  pair implements Comparator<pair>{
    int  first;
    int  second;
    //int third;
    pair(){}
    pair(int a,int s){
        first = a;
        second = s;

    }

   /* pair(pair a,pair b){
        first = a;
        second = b;
    }*/
    @Override
    public int compare(pair a,pair b){
        return (a.first-b.first);
    }
}


/*
 ~/BAU/ACM-ICPC/Teams/Rampage/MMZA
 ~/sudo apt-get verdict Accepted
 practice...
*/
//package javaapplication1;

//import java.util.Scanner;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static final int Mod=(int)1e9+7;
    static final int N=(int)2e5+5;
    public static void main(String[] args) throws IOException {
       // Reader.init(System.in);
        //Scanner in=new Scanner(new FileInputStream("input.txt"));
        FastReader in=new FastReader();
        StringBuilder sb=new StringBuilder();
        //in=new FileReader("input.txt");
        //PrintWriter out=new PrintWriter(new FileOutputStream("output.txt"));
        PrintWriter out=new PrintWriter(System.out);
        Main ob=new Main();
        int n=in.nextInt(),m=in.nextInt(),s=in.nextInt(),f=in.nextInt(),last=0;
        String res="";
        for(int i=1;i<=m&&s!=f;i++){

            int t=in.nextInt();
            int l=in.nextInt();
            int r=in.nextInt();

            while(last+1<t&&s!=f){
                if(s<f){
                    res+='R';
                    s++;
                }
                else if(s>f){
                    res+='L';
                    s--;
                }
                last++;
            }
            last=t;

            if(s==f)
                break;

            if(s>=l&&s<=r){
                res+='X';
                continue;
            }

            if(s<f){
                if(s+1>=l&&s+1<=r)
                    res+='X';
                else{
                    res+='R';
                    s++;
                }
            }
            else {
                if(s-1>=l&&s-1<=r)
                    res+='X';
                else{
                    res+='L';
                    s--;
                }
            }
        }
        out.println(res);

        out.close();
    }

    static int[] reverse(int [] arr){
        ArrayList<Integer> temp=new ArrayList();
        for(int i=0;i<arr.length;i++)
            temp.add(arr[i]);
        Collections.reverse(temp);
        for(int i=0;i<temp.size();i++)
            arr[i]=temp.get(i);
        return arr;
    }
    static String reverse(String s){
        String temp="";
        for(int i=s.length()-1;i>=0;i--)
            temp+=s.charAt(i);
        return temp;
    }
    static String sort(String inputString)
    {
        ArrayList<Character> arr=new ArrayList();
        for(int i=0;i<inputString.length();i++)
            arr.add(inputString.charAt(i));
        Collections.sort(arr);
        StringBuilder sb=new StringBuilder();
        for(int i=0;i<arr.size();i++)
            sb.append(arr.get(i));

        return sb.toString();
    }

    static boolean next_permutation(int[] p, int len) {
        int a = len - 2;
        while (a >= 0 && p[a] >= p[a + 1]) {
            a--;
        }

        if (a == -1) {
            return false;
        }

        int b = len - 1;
        while (p[b] <= p[a]) {
            b--;
        }

        p[a] += p[b];
        p[b] = p[a] - p[b];
        p[a] -= p[b];

        for (int i = a + 1, j = len - 1; i < j; i++, j--) {
            p[i] += p[j];
            p[j] = p[i] - p[j];
            p[i] -= p[j];
        }

        return true;
    }
    static int lower_bound(ArrayList<Integer> arr,int key) {
        int len = arr.size();
        int lo = 0;
        int hi = len-1;
        int mid = (lo + hi)/2;
        while (true) {
            int cmp = (arr.get(mid)==key?1:0);
            if (cmp == 0 || cmp > 0) {
                hi = mid-1;
                if (hi < lo)
                    return mid;
            } else {
                lo = mid+1;
                if (hi < lo)
                    return mid<len-1?mid+1:-1;
            }
            mid = (lo + hi)/2;
        }
    }
    static int upper_bound(ArrayList<Integer> arr, int key) {
        int len = arr.size();
        int lo = 0;
        int hi = len-1;
        int mid = (lo + hi)/2;
        while (true) {
            int cmp = (arr.get(mid)==key?1:0);
            if (cmp == 0 || cmp < 0) {
                lo = mid+1;
                if (hi < lo)
                    return mid<len-1?mid+1:-1;
            } else {
                hi = mid-1;
                if (hi < lo)
                    return mid;
            }
            mid = (lo + hi)/2;
        }
    }
    static int gcd(int a,int b){
        return b==0?a:gcd(b,a%b);
    }
    static double dot(Point p,Point q){
        return (p.x*q.x+p.y*q.y);
    }
    static double cross(Point p,Point q){
        return (p.x*q.y-p.y*q.x);
    }
    static Point computeLineIntersection(Point a,Point b,Point c,Point d){
        b=b.sub(a);d=c.sub(d);c=c.sub(a);
        return a.add(b.mulCon(cross(c,d)).devideCon(cross(b,d)));
    }
   static class FastReader
        {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

}
class Reader {

    static BufferedReader reader;
    static StringTokenizer tokenizer;

    static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(
                new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    static void init(String url) throws FileNotFoundException {
        reader = new BufferedReader(new FileReader(url));
        tokenizer = new StringTokenizer("");
    }

    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static String nextLine() throws IOException {
        return reader.readLine();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}
class Point{
    double x,y;
    Point(double _x,double _y){
        x=_x;
        y=_y;
    }
    Point add(final Point p){
        return new Point(x+p.x,y+p.y);
    }
    Point sub(final Point p){
        return new Point(x-p.x,y-p.y);
    }
    Point mulCon(final double c){
        return new Point(c*x,c*y);
    }
    Point devideCon(final double c){
        return new Point(x/c,y/c);
    }
}
class  pair implements Comparator<pair>{
    int  first;
    int  second;
    //int third;
    pair(){}
    pair(int a,int s){
        first = a;
        second = s;

    }

   /* pair(pair a,pair b){
        first = a;
        second = b;
    }*/
    @Override
    public int compare(pair a,pair b){
        return (a.first-b.first);
    }
}


import java.util.*;
import java.io.*;
public class A {
		    public static void main(String[] args) throws IOException {
		    	FastReader sc=new FastReader();
		    	int n=sc.nextInt();
		    	int m=sc.nextInt();
		    	int s=sc.nextInt();
		    	int f=sc.nextInt();
		    	int t[]=new int[m];
		    	int l[]=new int[m];
		    	int r[]=new int[m];
		    	for(int i=0;i<m;i++){
		    		t[i]=sc.nextInt();
		    		l[i]=sc.nextInt();
		    		r[i]=sc.nextInt();
		    	}
		    	 StringBuilder sb=new StringBuilder("");
		    	if(s<f){
		    		int p=s,c=1;

		    		 for(int i=0;i<m;){
		    			 if(p==f) break;
		    			 if(c==t[i]){
		    				  if((p+1>=l[i] && p+1<=r[i]) || (p>=l[i] && p<=r[i])) sb.append("X");
		    				  else {
		    					  sb.append("R");
		    				      p++;
		    				  }
		    				  i++;
		    			  }
		    			 else {
		    				 sb.append("R");
		    				 p++;
		    			 }
		    			 c++;
		    		 }

		    			 while(p!=f){
		    				 sb.append("R");
		    				 p++;
		    			 }

		    	}
		    	else {
		    		 int p=s,c=1;

		    		 for(int i=0;i<m;){
		    			 if(p==f) break;
		    			 if(c==t[i]){
		    				 if((p-1>=l[i] && p-1<=r[i]) || (p>=l[i] && p<=r[i])) sb.append("X");
		    				 else {
		    					 sb.append("L");
		    					 p--;
		    				 }
		    				 i++;
		    			 }else {
		    				 sb.append("L");
		    				 p--;

		    			 }
		    			// System.out.println(sb);
		    			 c++;

		    		 }
		    		 while(p!=f){
		    			 sb.append("L");
		    			 p--;
		    		 }
		    	}
		    	System.out.println(sb);

		    }

       static class FastReader
		    {
		        BufferedReader br;
		        StringTokenizer st;

		        public FastReader(){
		        		br = new BufferedReader(new InputStreamReader(System.in));
		        }

		        String next()
		        {
		            while (st == null || !st.hasMoreElements())
		            {
		                try
		                {
		                    st = new StringTokenizer(br.readLine());
		                }
		                catch (IOException  e)
		                {
		                    e.printStackTrace();
		                }
		            }
		            return st.nextToken();
		        }

		        int nextInt()
		        {
		            return Integer.parseInt(next());
		        }

		        long nextLong()
		        {
		            return Long.parseLong(next());
		        }

		        double nextDouble()
		        {
		            return Double.parseDouble(next());
		        }

		        String nextLine()
		        {
		            String str = "";
		            try
		            {
		                str = br.readLine();
		            }
		            catch (IOException e)
		            {
		                e.printStackTrace();
		            }
		            return str;
		        }
		    }
}


import java.io.*;
import java.util.*;

/**
 * Created by Желтяков on 17.03.2017.
 */
public class app {

    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in/*new FileReader(new File("badsubs.in"))*/);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int s = scanner.nextInt();
        int f = scanner.nextInt();
        int[][] a = new int[n][3];
        String str = "";
        int pos = s;
        for (int i = 0; i < n; i++) {
            a[i][0] = scanner.nextInt();
            a[i][1] = scanner.nextInt();
            a[i][2] = scanner.nextInt();
        }
        int i = 0;
        int t = 0;
        while (pos != f) {
            t++;
            boolean flag = false;
            if (i < n) {
                while (t == a[i][0]) {
                    if (f > s) {
                        if ((pos+1 >= a[i][1]&& pos <= a[i][2])) {
                            flag = true;
                        }
                    } else {
                        if ((pos >= a[i][1] && pos-1 <= a[i][2])) {
                            flag = true;
                        }
                    }
                    i++;
                    if (i == n) {
                        break;
                    }
                }
            }
            if (flag) {
                str += "X";
            } else {
                if (f > s) {
                    str += "R";
                    pos++;
                } else {
                    str += "L";
                    pos--;
                }
            }
        }
        System.out.println(str);
    }
}


import java.io.*;
import java.util.*;

/**
 * Created by Желтяков on 17.03.2017.
 */
public class app {

    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in/*new FileReader(new File("badsubs.in"))*/);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int s = scanner.nextInt();
        int f = scanner.nextInt();
        int[][] a = new int[m][3];
        String str = "";
        int pos = s;
        for (int i = 0; i <m ; i++) {
            a[i][0] = scanner.nextInt();
            a[i][1] = scanner.nextInt();
            a[i][2] = scanner.nextInt();
        }
        int i = 0;
        int t = 0;
        while (pos != f) {
            t++;
            boolean flag = false;
            if (i < m) {
                while (t == a[i][0]) {
                    if (f > s) {
                        if ((pos+1 >= a[i][1]&& pos <= a[i][2])) {
                            flag = true;
                        }
                    } else {
                        if ((pos >= a[i][1] && pos-1 <= a[i][2])) {
                            flag = true;
                        }
                    }
                    i++;
                    if (i == m) {
                        break;
                    }
                }
            }
            if (flag) {
                str += "X";
            } else {
                if (f > s) {
                    str += "R";
                    pos++;
                } else {
                    str += "L";
                    pos--;
                }
            }
        }
        System.out.println(str);
    }
}


import java.io.*;
import java.util.*;

/**
 * Created by Желтяков on 17.03.2017.
 */
public class app {

    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in/*new FileReader(new File("badsubs.in"))*/);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int s = scanner.nextInt();
        int f = scanner.nextInt();
        int[][] a = new int[m][3];
        StringBuffer sb=new StringBuffer();
        int pos = s;
        for (int i = 0; i <m ; i++) {
            a[i][0] = scanner.nextInt();
            a[i][1] = scanner.nextInt();
            a[i][2] = scanner.nextInt();
        }
        int i = 0;
        int t = 0;
        while (pos != f) {
            t++;
            boolean flag = false;
            if (i < m) {
                while (t == a[i][0]) {
                    if (f > s) {
                        if ((pos+1 >= a[i][1]&& pos <= a[i][2])) {
                            flag = true;
                        }
                    } else {
                        if ((pos >= a[i][1] && pos-1 <= a[i][2])) {
                            flag = true;
                        }
                    }
                    i++;
                    if (i == m) {
                        break;
                    }
                }
            }
            if (flag) {
                sb.append("X");
            } else {
                if (f > s) {
                    sb.append("R");
                    pos++;
                } else {
                    sb.append("L");
                    pos--;
                }
            }
        }
        System.out.println(sb.toString());
    }
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
public class A {

		    public static void main(String[] args) throws IOException {
		    	FastReader sc=new FastReader();
		    	int n=sc.nextInt();
		    	int m=sc.nextInt();
		    	int s=sc.nextInt();
		    	int f=sc.nextInt();
		    	int t[]=new int[m];
		    	int l[]=new int[m];
		    	int r[]=new int[m];
		    	for(int i=0;i<m;i++){
		    		t[i]=sc.nextInt();
		    		l[i]=sc.nextInt();
		    		r[i]=sc.nextInt();
		    	}
		    	 StringBuilder sb=new StringBuilder("");
		    	if(s<f){
		    		int p=s,c=1;

		    		 for(int i=0;i<m;){
		    			 if(p==f) break;
		    			 if(c==t[i]){
		    				  if(p+1>=l[i] && p+1<=r[i]) sb.append("X");
		    				  else {
		    					  sb.append("R");
		    				      p++;
		    				  }
		    				  i++;
		    			  }
		    			 else {
		    				 p++;
		    			 }
		    			 c++;
		    		 }
		    	}
		    	else {
		    		 int p=f,c=1;

		    		 for(int i=0;i<m;){
		    			 if(p==s) break;
		    			 if(c==t[i]){
		    				 if(p+1>=l[i] && p+1<=r[i]) sb.append("X");
		    				 else {
		    					 sb.append("L");
		    					 p--;
		    				 }
		    				 i++;
		    			 }else {
		    				 p--;
		    			 }
		    			 c++;
		    		 }
		    	}
		    	System.out.println(sb);

		    }

       static class FastReader
		    {
		        BufferedReader br;
		        StringTokenizer st;

		        public FastReader(){
		        		br = new BufferedReader(new InputStreamReader(System.in));
		        }

		        String next()
		        {
		            while (st == null || !st.hasMoreElements())
		            {
		                try
		                {
		                    st = new StringTokenizer(br.readLine());
		                }
		                catch (IOException  e)
		                {
		                    e.printStackTrace();
		                }
		            }
		            return st.nextToken();
		        }

		        int nextInt()
		        {
		            return Integer.parseInt(next());
		        }

		        long nextLong()
		        {
		            return Long.parseLong(next());
		        }

		        double nextDouble()
		        {
		            return Double.parseDouble(next());
		        }

		        String nextLine()
		        {
		            String str = "";
		            try
		            {
		                str = br.readLine();
		            }
		            catch (IOException e)
		            {
		                e.printStackTrace();
		            }
		            return str;
		        }
		    }
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
public class A {

		    public static void main(String[] args) throws IOException {
		    	FastReader sc=new FastReader();
		    	int n=sc.nextInt();
		    	int m=sc.nextInt();
		    	int s=sc.nextInt();
		    	int f=sc.nextInt();
		    	int t[]=new int[m];
		    	int l[]=new int[m];
		    	int r[]=new int[m];
		    	for(int i=0;i<m;i++){
		    		t[i]=sc.nextInt();
		    		l[i]=sc.nextInt();
		    		r[i]=sc.nextInt();
		    	}
		    	 StringBuilder sb=new StringBuilder("");
		    	if(s<f){
		    		int p=s,c=1;

		    		 for(int i=0;i<m;){
		    			 if(p==f) break;
		    			 if(c==t[i]){
		    				  if((p+1>=l[i] && p+1<=r[i]) || (p>=l[i] && p<=r[i])) sb.append("X");
		    				  else {
		    					  sb.append("R");
		    				      p++;
		    				  }
		    				  i++;
		    			  }
		    			 else {
		    				 sb.append("R");
		    				 p++;
		    			 }
		    			 c++;
		    		 }

		    			 while(p!=f){
		    				 sb.append("R");
		    				 p++;
		    			 }

		    	}
		    	else {
		    		 int p=s,c=1;

		    		 for(int i=0;i<m;){
		    			 if(p==f) break;
		    			 if(c==t[i]){
		    				 if((p-1>=l[i] && p-1<=r[i]) || (p>=l[i] && p<=r[i])) sb.append("X");
		    				 else {
		    					 sb.append("L");
		    					 p--;
		    				 }
		    				 i++;
		    			 }else {
		    				 sb.append("L");
		    				 p--;

		    			 }
		    			// System.out.println(sb);
		    			 c++;

		    		 }
		    		 while(p!=f){
		    			 sb.append("L");
		    			 p--;
		    		 }
		    	}
		    	System.out.println(sb);

		    }

       static class FastReader
		    {
		        BufferedReader br;
		        StringTokenizer st;

		        public FastReader(){
		        		br = new BufferedReader(new InputStreamReader(System.in));
		        }

		        String next()
		        {
		            while (st == null || !st.hasMoreElements())
		            {
		                try
		                {
		                    st = new StringTokenizer(br.readLine());
		                }
		                catch (IOException  e)
		                {
		                    e.printStackTrace();
		                }
		            }
		            return st.nextToken();
		        }

		        int nextInt()
		        {
		            return Integer.parseInt(next());
		        }

		        long nextLong()
		        {
		            return Long.parseLong(next());
		        }

		        double nextDouble()
		        {
		            return Double.parseDouble(next());
		        }

		        String nextLine()
		        {
		            String str = "";
		            try
		            {
		                str = br.readLine();
		            }
		            catch (IOException e)
		            {
		                e.printStackTrace();
		            }
		            return str;
		        }
		    }
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
public class A {

		    public static void main(String[] args) throws IOException {
		    	FastReader sc=new FastReader();
		    	int n=sc.nextInt();
		    	int m=sc.nextInt();
		    	int s=sc.nextInt();
		    	int f=sc.nextInt();
		    	int t[]=new int[m];
		    	int l[]=new int[m];
		    	int r[]=new int[m];
		    	for(int i=0;i<m;i++){
		    		t[i]=sc.nextInt();
		    		l[i]=sc.nextInt();
		    		r[i]=sc.nextInt();
		    	}
		    	 StringBuilder sb=new StringBuilder("");
		    	if(s<f){
		    		int p=s,c=1;

		    		 for(int i=0;i<m;){
		    			 if(p==f) break;
		    			 if(c==t[i]){
		    				  if((p+1>=l[i] && p+1<=r[i]) || (p>=l[i] && p<=r[i])) sb.append("X");
		    				  else {
		    					  sb.append("R");
		    				      p++;
		    				  }
		    				  i++;
		    			  }
		    			 else {
		    				 sb.append("R");
		    				 p++;
		    			 }
		    			 c++;
		    		 }
		    	}
		    	else {
		    		 int p=s,c=1;

		    		 for(int i=0;i<m;){
		    			 if(p==f) break;
		    			 if(c==t[i]){
		    				 if((p-1>=l[i] && p-1<=r[i]) || (p>=l[i] && p<=r[i])) sb.append("X");
		    				 else {
		    					 sb.append("L");
		    					 p--;
		    				 }
		    				 i++;
		    			 }else {
		    				 sb.append("L");
		    				 p--;

		    			 }
		    			// System.out.println(sb);
		    			 c++;

		    		 }
		    	}
		    	System.out.println(sb);

		    }

       static class FastReader
		    {
		        BufferedReader br;
		        StringTokenizer st;

		        public FastReader(){
		        		br = new BufferedReader(new InputStreamReader(System.in));
		        }

		        String next()
		        {
		            while (st == null || !st.hasMoreElements())
		            {
		                try
		                {
		                    st = new StringTokenizer(br.readLine());
		                }
		                catch (IOException  e)
		                {
		                    e.printStackTrace();
		                }
		            }
		            return st.nextToken();
		        }

		        int nextInt()
		        {
		            return Integer.parseInt(next());
		        }

		        long nextLong()
		        {
		            return Long.parseLong(next());
		        }

		        double nextDouble()
		        {
		            return Double.parseDouble(next());
		        }

		        String nextLine()
		        {
		            String str = "";
		            try
		            {
		                str = br.readLine();
		            }
		            catch (IOException e)
		            {
		                e.printStackTrace();
		            }
		            return str;
		        }
		    }
}


import java.util.Scanner;

public class XeniaAndSpies {
	@SuppressWarnings("unused")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int spies = sc.nextInt();
		int steps = sc.nextInt();
		int start = sc.nextInt();
		int finish = sc.nextInt();
		int mat[][] = new int[3][100000];
		int currentStep = 0, i;
		for(i = 0; i < steps; i++) {
			mat[0][i] = sc.nextInt();
			mat[1][i] = sc.nextInt();
			mat[2][i] = sc.nextInt();
		}
		i = 0;
		while(start != finish) {
			currentStep++;
			if(start < finish) {
				if(mat[0][i] == currentStep) {

					if(mat[1][i] > start+1 || mat[2][i] < start) {
						start++;
						System.out.print("R");
					} else {
						System.out.print("X");
					}
					i++;
				} else {
					start++;
					System.out.print("R");
				}
			} else {
				// finish < start
				if(mat[0][i] == currentStep) {
					if(mat[1][i] > start || mat[2][i] < start-1) {
						start--;
						System.out.print("L");
					} else {
						System.out.print("X");
					}
					i++;
				} else {
					start--;
					System.out.print("L");
				}
			}
		}
	}
}


import java.util.Scanner;

public class XeniaAndSpies {
	@SuppressWarnings("unused")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int spies = sc.nextInt();
		int steps = sc.nextInt();
		int start = sc.nextInt();
		int finish = sc.nextInt();
		int mat[][] = new int[3][steps];
		int currentStep = 0, i;
		for(i = 0; i < steps; i++) {
			mat[0][i] = sc.nextInt();
			mat[1][i] = sc.nextInt();
			mat[2][i] = sc.nextInt();
		}
		i = 0;
		while(start != finish) {
			currentStep++;
			if(start < finish) {
				if(mat[0][i] == currentStep) {

					if(mat[1][i] > start+1 || mat[2][i] < start) {
						start++;
						System.out.print("R");
					} else {
						System.out.print("X");
					}
					i++;
				} else {
					start++;
					System.out.print("R");
				}
			} else {
				// finish < start
				if(mat[0][i] == currentStep) {
					if(mat[1][i] > start || mat[2][i] < start-1) {
						start--;
						System.out.print("L");
					} else {
						System.out.print("X");
					}
					i++;
				} else {
					start--;
					System.out.print("L");
				}
			}
		}
	}
}


import java.util.Scanner;

public class XeniaAndSpies {
	@SuppressWarnings("unused")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int spies = sc.nextInt();
		int steps = sc.nextInt();
		int start = sc.nextInt();
		int finish = sc.nextInt();
		int mat[][] = new int[3][100001];
		int currentStep = 0, i;
		for(i = 0; i < steps; i++) {
			mat[0][i] = sc.nextInt();
			mat[1][i] = sc.nextInt();
			mat[2][i] = sc.nextInt();
		}
		i = 0;
		while(start != finish) {
			currentStep++;
			if(start < finish) {
				if(mat[0][i] == currentStep) {

					if(mat[1][i] > start+1 || mat[2][i] < start) {
						start++;
						System.out.print("R");
					} else {
						System.out.print("X");
					}
					i++;
				} else {
					start++;
					System.out.print("R");
				}
			} else {
				// finish < start
				if(mat[0][i] == currentStep) {
					if(mat[1][i] > start || mat[2][i] < start-1) {
						start--;
						System.out.print("L");
					} else {
						System.out.print("X");
					}
					i++;
				} else {
					start--;
					System.out.print("L");
				}
			}
		}
	}
}


import java.util.Scanner;

public class XeniaAndSpies {
	@SuppressWarnings("unused")
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int spies = sc.nextInt();
		int steps = sc.nextInt();
		int start = sc.nextInt();
		int finish = sc.nextInt();
		int mat[][] = new int[3][steps];
		int currentStep = 0, i;
		for(i = 0; i < steps; i++) {
			mat[0][i] = sc.nextInt();
			mat[1][i] = sc.nextInt();
			mat[2][i] = sc.nextInt();
		}
		i = -1;
		while(start != finish) {
			currentStep++;
			i++;
			if(start < finish) {
				if(mat[0][i] == currentStep) {
					if(mat[1][i] > start+1 || mat[2][i] < start) {
						start++;
						System.out.print("R");
					} else {
						System.out.print("X");
					}
				} else {
					start++;
					System.out.print("R");
				}
			} else {
				// start > finish
				if(mat[0][i] == currentStep) {
					if(mat[1][i]  > start || mat[2][i] < start-1) {
						start--;
						System.out.print("L");
					} else {
						System.out.print("X");
					}
				} else {
					start--;
					System.out.print("L");
				}
			}
		}
	}
}


import java.io.*;
import java.util.*;
public class Main
{
    public static void main(String[] args) throws IOException
    {
        //Locale.setDefault (Locale.US);
        Reader in = new Reader();
        StringBuilder out = new StringBuilder();
        int n, m, s, f, t, l , r, curr, mv;
        char cr;

        //for (int i = 0; i < 2; i++)
        {
            n = in.nextInt();
            m = in.nextInt();
            s = in.nextInt();
            f = in.nextInt();

            curr=s;
            if(s < f){
                mv = 1;
                cr = 'R';
            }
            else{
                mv = -1;
                cr = 'L';
            }

            for (int j = 0, c = 1; j < m; j++, c++)
            {
                t = in.nextInt();
                l = in.nextInt();
                r = in.nextInt();

                while( t > c && curr != f){
                    out.append(cr);
                    curr+=mv;
                    c++;
                }
                if(curr==f)continue;
                if( (curr+mv < l || curr+mv > r) && (curr < l || curr > r)){
                    out.append(cr);
                    curr+=mv;
                }
                else
                    out.append("X");
            }

            System.out.println(out);

            out = new StringBuilder();

        }
    }
    static class  Reader
    {
        BufferedReader br;
        StringTokenizer st;
        Reader() { // To read from the standard input
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        Reader(int i) throws IOException { // To read from a file
            br = new BufferedReader(new FileReader("Sample Input.txt"));
        }
       String next() throws IOException {
          while (st == null || !st.hasMoreTokens())
             st = new StringTokenizer(br.readLine());
          return st.nextToken();
       }
       int nextInt() throws IOException { return Integer.parseInt(next()); }
       long nextLong() throws IOException { return Long.parseLong(next()); }
       double nextDouble() throws IOException { return Double.parseDouble(next()); }
       String nextLine() throws IOException { return br.readLine(); }
    }

}


import java.io.*;
import java.util.*;
public class XeniaAndSpies
{
    public static void main(String[] args) throws IOException
    {
        //Locale.setDefault (Locale.US);
        Reader in = new Reader();
        StringBuilder out = new StringBuilder();
        int n, m, s, f, t, l , r, curr, mv;
        char cr;

        //for (int i = 0; i < 8; i++)
        {
            n = in.nextInt();
            m = in.nextInt();
            s = in.nextInt();
            f = in.nextInt();

            curr=s;
            if(s < f){
                mv = 1;
                cr = 'R';
            }
            else{
                mv = -1;
                cr = 'L';
            }

            for (int j = 0, c = 1; j < m; j++, c++)
            {
                t = in.nextInt();
                l = in.nextInt();
                r = in.nextInt();

                while( t > c && curr != f){
                    out.append(cr);
                    curr+=mv;
                    c++;
                }
                if(curr==f)continue;
                if( (curr+mv < l || curr+mv > r) && (curr < l || curr > r)){
                    out.append(cr);
                    curr+=mv;
                }
                else
                    out.append("X");
            }
            while(curr != f)
            {
                curr+=mv;
                out.append(cr);
            }
            System.out.println(out);

            out = new StringBuilder();

        }
    }
    static class  Reader
    {
        BufferedReader br;
        StringTokenizer st;
        Reader() { // To read from the standard input
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        Reader(int i) throws IOException { // To read from a file
            br = new BufferedReader(new FileReader("Sample Input.txt"));
        }
       String next() throws IOException {
          while (st == null || !st.hasMoreTokens())
             st = new StringTokenizer(br.readLine());
          return st.nextToken();
       }
       int nextInt() throws IOException { return Integer.parseInt(next()); }
       long nextLong() throws IOException { return Long.parseLong(next()); }
       double nextDouble() throws IOException { return Double.parseDouble(next()); }
       String nextLine() throws IOException { return br.readLine(); }
    }

}


//B. Xenia and Spies
//time limit per test2 seconds
//memory limit per test256 megabytes
//inputstandard input
//outputstandard output
//Xenia the vigorous detective faced n (n ≥ 2) foreign spies lined up in a row. We'll consider the spies numbered from 1 to n from left to right.

//Spy s has an important note. He has to pass the note to spy f. Xenia interrogates the spies in several steps. During one step the spy keeping the important note can pass the note to one of his neighbours in the row. In other words, if this spy's number is x, he can pass the note to another spy, either x - 1 or x + 1 (if x = 1 or x = n, then the spy has only one neighbour). Also during a step the spy can keep a note and not pass it to anyone.

//But nothing is that easy. During m steps Xenia watches some spies attentively. Specifically, during step ti (steps are numbered from 1) Xenia watches spies numbers li, li + 1, li + 2, ..., ri (1 ≤ li ≤ ri ≤ n). Of course, if during some step a spy is watched, he can't do anything: neither give the note nor take it from some other spy. Otherwise, Xenia reveals the spies' cunning plot. Nevertheless, if the spy at the current step keeps the note, Xenia sees nothing suspicious even if she watches him.

//You've got s and f. Also, you have the steps during which Xenia watches spies and which spies she is going to watch during each step. Find the best way the spies should act in order to pass the note from spy s to spy f as quickly as possible (in the minimum number of steps).

//Input
//The first line contains four integers n, m, s and f (1 ≤ n, m ≤ 105; 1 ≤ s, f ≤ n; s ≠ f; n ≥ 2). Each of the following m lines contains three integers ti, li, ri (1 ≤ ti ≤ 109, 1 ≤ li ≤ ri ≤ n). It is guaranteed that t1 < t2 < t3 < ... < tm.

//Output
//Print k characters in a line: the i-th character in the line must represent the spies' actions on step i. If on step i the spy with the note must pass the note to the spy with a lesser number, the i-th character should equal "L". If on step i the spy with the note must pass it to the spy with a larger number, the i-th character must equal "R". If the spy must keep the note at the i-th step, the i-th character must equal "X".

//As a result of applying the printed sequence of actions spy s must pass the note to spy f. The number of printed characters k must be as small as possible. Xenia must not catch the spies passing the note.

//If there are miltiple optimal solutions, you can print any of them. It is guaranteed that the answer exists.

//Sample test(s)
//input
//3 5 1 3
//1 1 2
//2 2 3
//3 3 3
//4 1 1
//10 1 3
//output
//XXRR

import java.util.*;
import java.io.*;
import java.awt.Point;
import static java.lang.Math.*;

public class Solution {

    public static int numspies;
    public static int numsteps;
    public static int start;
    public static int end;
    public static int currentspy; //spy who has the note
    public static ArrayList<Character> steps;

    public static void main(String[] args) throws Exception {
        Solution temp = new Solution();
    }

    public Solution() throws Exception {
        steps = new ArrayList<Character>();
        readFile();
        for (int i = 0; i < steps.size(); i++) {
            System.out.print(steps.get(i));
        }
        System.out.println();
    }

    private static void readFile() throws Exception {
        //Scanner is used for parsing tokens from the contents of the stream
        Scanner in = new Scanner(System.in);

        //BufferedReader just reads the stream and does not do any special parsing.
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        String line = in.nextLine();
        String[] ints = line.split(" ");
        numspies = Integer.parseInt(ints[0]);
        numsteps = Integer.parseInt(ints[1]);
        start = Integer.parseInt(ints[2]);
        end = Integer.parseInt(ints[3]);

        currentspy = start;

        int counter = 0;
        //it seems like we never want to pass backwards/away from the direction of spy destination f. We always
        //want to pass towards it. So in a way it's greedy - we always pass to the very next spy for each new turn
        //as long as Xenia isn't watching

        int priorstep = 0;
        //iterate through each turn/step
        while (counter < numsteps) {
            counter++;
            line = in.nextLine();
            String[] data = line.split(" ");
            int currentstep = Integer.parseInt(data[0]);
            int rangestart;
            int rangeend;
            //if Xenia didn't take a step off e.g. went from step 1 to step 2
            if (currentstep - priorstep == 1) {
                rangestart = Integer.parseInt(data[1]);
                rangeend = Integer.parseInt(data[2]);
            }
            //Xenia took a step off/didn't examine any spies whatsoever for a step/steps: examination range is
            //nonexistent e.g. went from step 1 to step 3
            else {
                rangestart = 0;
                rangeend = 0;
            }
            //we now have the start and the end of the range of spies being watched, so we iterate through the
            //number of turns from the line before to the line just read

            int iteration = 0;
            while (iteration < currentstep - priorstep) {
                //if we've iterate through the steps that Xenia took off and have finally reached the step she
                //started examining again, apply the range
                if (iteration == currentstep - priorstep - 1) {
                    rangestart = Integer.parseInt(data[1]);
                    rangeend = Integer.parseInt(data[2]);
                }

                //if the note is on the end of the list of spies
                if (currentspy == 1 || currentspy == numspies) {
                    //we want to pass note to the right, only one way to go since note is on left end
                    if (currentspy < end) {
                        //if the current spy and its right neighbor are not being examined, pass to the right
                        if ((currentspy < rangestart || currentspy > rangeend) && (currentspy + 1 < rangestart || currentspy + 1 > rangeend)) {
                            currentspy++;
                            steps.add('R');
                        }
                        else {
                            steps.add('X');
                        }
                    }
                    //we want to pass the note to the left
                    else if (currentspy > end) {
                        //if the current spy and its left neighbor are not being examined, pass to the left
                        if ((currentspy < rangestart || currentspy > rangeend) && (currentspy - 1 < rangestart || currentspy - 1 > rangeend)) {
                            currentspy--;
                            steps.add('L');
                        }
                        else {
                            steps.add('X');
                        }
                    }
                    //note reached destination
                    else {
                        return;
                    }
                }
                //spy who has note has two neighbors
                else {
                    //we want to pass note to the right
                    if (currentspy < end) {
                        //if the current spy and its right neighbor are not being examined, pass to the right
                        if ((currentspy < rangestart || currentspy > rangeend) && (currentspy + 1 < rangestart || currentspy + 1 > rangeend)) {
                            currentspy++;
                            steps.add('R');
                        }
                        else {
                            steps.add('X');
                        }
                    }
                    //we want to pass the note to the left
                    else if (currentspy > end) {
                        //if the current spy and its left neighbor are not being examined, pass to the left
                        if ((currentspy < rangestart || currentspy > rangeend) && (currentspy - 1 < rangestart || currentspy - 1 > rangeend)) {
                            currentspy--;
                            steps.add('L');
                        }
                        else {
                            steps.add('X');
                        }
                    }
                    //note reached destination
                    else {
                        return;
                    }
                }
                iteration++;
            }
            //we finished processing a line of input, so the prior step is bumped up to current step before current
            //step moves to the next one
            priorstep = currentstep;
        }
        //we haven't yet returned from this function, so the destination spy has not yet been reached but Xenia has
        //finished all examination steps
        while (currentspy < end) {
            currentspy++;
            steps.add('R');
        }
        while (currentspy > end) {
            currentspy--;
            steps.add('L');
        }
    }
}


//B. Xenia and Spies
//time limit per test2 seconds
//memory limit per test256 megabytes
//inputstandard input
//outputstandard output
//Xenia the vigorous detective faced n (n ≥ 2) foreign spies lined up in a row. We'll consider the spies numbered from 1 to n from left to right.

//Spy s has an important note. He has to pass the note to spy f. Xenia interrogates the spies in several steps. During one step the spy keeping the important note can pass the note to one of his neighbours in the row. In other words, if this spy's number is x, he can pass the note to another spy, either x - 1 or x + 1 (if x = 1 or x = n, then the spy has only one neighbour). Also during a step the spy can keep a note and not pass it to anyone.

//But nothing is that easy. During m steps Xenia watches some spies attentively. Specifically, during step ti (steps are numbered from 1) Xenia watches spies numbers li, li + 1, li + 2, ..., ri (1 ≤ li ≤ ri ≤ n). Of course, if during some step a spy is watched, he can't do anything: neither give the note nor take it from some other spy. Otherwise, Xenia reveals the spies' cunning plot. Nevertheless, if the spy at the current step keeps the note, Xenia sees nothing suspicious even if she watches him.

//You've got s and f. Also, you have the steps during which Xenia watches spies and which spies she is going to watch during each step. Find the best way the spies should act in order to pass the note from spy s to spy f as quickly as possible (in the minimum number of steps).

//Input
//The first line contains four integers n, m, s and f (1 ≤ n, m ≤ 105; 1 ≤ s, f ≤ n; s ≠ f; n ≥ 2). Each of the following m lines contains three integers ti, li, ri (1 ≤ ti ≤ 109, 1 ≤ li ≤ ri ≤ n). It is guaranteed that t1 < t2 < t3 < ... < tm.

//Output
//Print k characters in a line: the i-th character in the line must represent the spies' actions on step i. If on step i the spy with the note must pass the note to the spy with a lesser number, the i-th character should equal "L". If on step i the spy with the note must pass it to the spy with a larger number, the i-th character must equal "R". If the spy must keep the note at the i-th step, the i-th character must equal "X".

//As a result of applying the printed sequence of actions spy s must pass the note to spy f. The number of printed characters k must be as small as possible. Xenia must not catch the spies passing the note.

//If there are miltiple optimal solutions, you can print any of them. It is guaranteed that the answer exists.

//Sample test(s)
//input
//3 5 1 3
//1 1 2
//2 2 3
//3 3 3
//4 1 1
//10 1 3
//output
//XXRR

import java.util.*;
import java.io.*;
import java.awt.Point;
import static java.lang.Math.*;

public class Solution {

    public static int numspies;
    public static int numsteps;
    public static int start;
    public static int end;
    public static int currentspy; //spy who has the note
    public static ArrayList<Character> steps;

    public static void main(String[] args) throws Exception {
        Solution temp = new Solution();
    }

    public Solution() throws Exception {
        steps = new ArrayList<Character>();
        readFile();
        for (int i = 0; i < steps.size(); i++) {
            System.out.print(steps.get(i));
        }
    }

    private static void readFile() throws Exception {
        //Scanner is used for parsing tokens from the contents of the stream
        Scanner in = new Scanner(System.in);

        //BufferedReader just reads the stream and does not do any special parsing.
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        String line = in.nextLine();
        String[] ints = line.split(" ");
        numspies = Integer.parseInt(ints[0]);
        numsteps = Integer.parseInt(ints[1]);
        start = Integer.parseInt(ints[2]);
        end = Integer.parseInt(ints[3]);

        currentspy = start;

        int counter = 0;
        //it seems like we never want to pass backwards/away from the direction of spy destination f. We always
        //want to pass towards it. So in a way it's greedy - we always pass to the very next spy for each new turn
        //as long as Xenia isn't watching

        //iterate through each turn/step
        while (counter < numsteps) {
            line = in.nextLine();
            String[] data = line.split(" ");
            int rangestart = Integer.parseInt(data[1]);
            int rangeend = Integer.parseInt(data[2]);
            //we now have the start and the end of the range of spies being watched

            //if the note is on the end of the list of spies
            if (currentspy == 1 || currentspy == numspies) {
                //we want to pass note to the right, only one way to go since note is on left end
                if (currentspy < end) {
                    //if the current spy and its right neighbor are not being examined, pass to the right
                    if ((currentspy < rangestart || currentspy > rangeend) && (currentspy + 1 < rangestart || currentspy + 1 > rangeend)) {
                        currentspy++;
                        steps.add('R');
                    }
                    else {
                        steps.add('X');
                    }
                }
                //we want to pass the note to the left
                else if (currentspy > end) {
                    //if the current spy and its left neighbor are not being examined, pass to the left
                    if ((currentspy < rangestart || currentspy > rangeend) && (currentspy - 1 < rangestart || currentspy - 1 > rangeend)) {
                        currentspy--;
                        steps.add('L');
                    }
                    else {
                        steps.add('X');
                    }
                }
                //note reached destination
                else {
                    return;
                }
            }
            //spy who has note has two neighbors
            else {
                //we want to pass note to the right
                if (currentspy < end) {
                    //if the current spy and its right neighbor are not being examined, pass to the right
                    if ((currentspy < rangestart || currentspy > rangeend) && (currentspy + 1 < rangestart || currentspy + 1 > rangeend)) {
                        currentspy++;
                        steps.add('R');
                    }
                    else {
                        steps.add('X');
                    }
                }
                //we want to pass the note to the left
                else if (currentspy > end) {
                    //if the current spy and its left neighbor are not being examined, pass to the left
                    if ((currentspy < rangestart || currentspy > rangeend) && (currentspy - 1 < rangestart || currentspy - 1 > rangeend)) {
                        currentspy--;
                        steps.add('L');
                    }
                    else {
                        steps.add('X');
                    }
                }
                //note reached destination
                else {
                    return;
                }
            }
        }
    }
}


//B. Xenia and Spies
//time limit per test2 seconds
//memory limit per test256 megabytes
//inputstandard input
//outputstandard output
//Xenia the vigorous detective faced n (n ≥ 2) foreign spies lined up in a row. We'll consider the spies numbered from 1 to n from left to right.

//Spy s has an important note. He has to pass the note to spy f. Xenia interrogates the spies in several steps. During one step the spy keeping the important note can pass the note to one of his neighbours in the row. In other words, if this spy's number is x, he can pass the note to another spy, either x - 1 or x + 1 (if x = 1 or x = n, then the spy has only one neighbour). Also during a step the spy can keep a note and not pass it to anyone.

//But nothing is that easy. During m steps Xenia watches some spies attentively. Specifically, during step ti (steps are numbered from 1) Xenia watches spies numbers li, li + 1, li + 2, ..., ri (1 ≤ li ≤ ri ≤ n). Of course, if during some step a spy is watched, he can't do anything: neither give the note nor take it from some other spy. Otherwise, Xenia reveals the spies' cunning plot. Nevertheless, if the spy at the current step keeps the note, Xenia sees nothing suspicious even if she watches him.

//You've got s and f. Also, you have the steps during which Xenia watches spies and which spies she is going to watch during each step. Find the best way the spies should act in order to pass the note from spy s to spy f as quickly as possible (in the minimum number of steps).

//Input
//The first line contains four integers n, m, s and f (1 ≤ n, m ≤ 105; 1 ≤ s, f ≤ n; s ≠ f; n ≥ 2). Each of the following m lines contains three integers ti, li, ri (1 ≤ ti ≤ 109, 1 ≤ li ≤ ri ≤ n). It is guaranteed that t1 < t2 < t3 < ... < tm.

//Output
//Print k characters in a line: the i-th character in the line must represent the spies' actions on step i. If on step i the spy with the note must pass the note to the spy with a lesser number, the i-th character should equal "L". If on step i the spy with the note must pass it to the spy with a larger number, the i-th character must equal "R". If the spy must keep the note at the i-th step, the i-th character must equal "X".

//As a result of applying the printed sequence of actions spy s must pass the note to spy f. The number of printed characters k must be as small as possible. Xenia must not catch the spies passing the note.

//If there are miltiple optimal solutions, you can print any of them. It is guaranteed that the answer exists.

//Sample test(s)
//input
//3 5 1 3
//1 1 2
//2 2 3
//3 3 3
//4 1 1
//10 1 3
//output
//XXRR

import java.util.*;
import java.io.*;
import java.awt.Point;
import static java.lang.Math.*;

public class Solution {

    public static int numspies;
    public static int numsteps;
    public static int start;
    public static int end;
    public static int currentspy; //spy who has the note
    public static ArrayList<Character> steps;

    public static void main(String[] args) throws Exception {
        Solution temp = new Solution();
    }

    public Solution() throws Exception {
        steps = new ArrayList<Character>();
        readFile();
        for (int i = 0; i < steps.size(); i++) {
            System.out.print(steps.get(i));
        }
        System.out.println();
    }

    private static void readFile() throws Exception {
        //Scanner is used for parsing tokens from the contents of the stream
        Scanner in = new Scanner(System.in);

        //BufferedReader just reads the stream and does not do any special parsing.
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        String line = in.nextLine();
        String[] ints = line.split(" ");
        numspies = Integer.parseInt(ints[0]);
        numsteps = Integer.parseInt(ints[1]);
        start = Integer.parseInt(ints[2]);
        end = Integer.parseInt(ints[3]);

        currentspy = start;

        int counter = 0;
        //it seems like we never want to pass backwards/away from the direction of spy destination f. We always
        //want to pass towards it. So in a way it's greedy - we always pass to the very next spy for each new turn
        //as long as Xenia isn't watching

        //iterate through each turn/step
        while (counter < numsteps) {
            counter++;
            line = in.nextLine();
            String[] data = line.split(" ");
            int rangestart = Integer.parseInt(data[1]);
            int rangeend = Integer.parseInt(data[2]);
            //we now have the start and the end of the range of spies being watched

            //if the note is on the end of the list of spies
            if (currentspy == 1 || currentspy == numspies) {
                //we want to pass note to the right, only one way to go since note is on left end
                if (currentspy < end) {
                    //if the current spy and its right neighbor are not being examined, pass to the right
                    if ((currentspy < rangestart || currentspy > rangeend) && (currentspy + 1 < rangestart || currentspy + 1 > rangeend)) {
                        currentspy++;
                        steps.add('R');
                    }
                    else {
                        steps.add('X');
                    }
                }
                //we want to pass the note to the left
                else if (currentspy > end) {
                    //if the current spy and its left neighbor are not being examined, pass to the left
                    if ((currentspy < rangestart || currentspy > rangeend) && (currentspy - 1 < rangestart || currentspy - 1 > rangeend)) {
                        currentspy--;
                        steps.add('L');
                    }
                    else {
                        steps.add('X');
                    }
                }
                //note reached destination
                else {
                    return;
                }
            }
            //spy who has note has two neighbors
            else {
                //we want to pass note to the right
                if (currentspy < end) {
                    //if the current spy and its right neighbor are not being examined, pass to the right
                    if ((currentspy < rangestart || currentspy > rangeend) && (currentspy + 1 < rangestart || currentspy + 1 > rangeend)) {
                        currentspy++;
                        steps.add('R');
                    }
                    else {
                        steps.add('X');
                    }
                }
                //we want to pass the note to the left
                else if (currentspy > end) {
                    //if the current spy and its left neighbor are not being examined, pass to the left
                    if ((currentspy < rangestart || currentspy > rangeend) && (currentspy - 1 < rangestart || currentspy - 1 > rangeend)) {
                        currentspy--;
                        steps.add('L');
                    }
                    else {
                        steps.add('X');
                    }
                }
                //note reached destination
                else {
                    return;
                }
            }
        }
    }
}


//B. Xenia and Spies
//time limit per test2 seconds
//memory limit per test256 megabytes
//inputstandard input
//outputstandard output
//Xenia the vigorous detective faced n (n ≥ 2) foreign spies lined up in a row. We'll consider the spies numbered from 1 to n from left to right.

//Spy s has an important note. He has to pass the note to spy f. Xenia interrogates the spies in several steps. During one step the spy keeping the important note can pass the note to one of his neighbours in the row. In other words, if this spy's number is x, he can pass the note to another spy, either x - 1 or x + 1 (if x = 1 or x = n, then the spy has only one neighbour). Also during a step the spy can keep a note and not pass it to anyone.

//But nothing is that easy. During m steps Xenia watches some spies attentively. Specifically, during step ti (steps are numbered from 1) Xenia watches spies numbers li, li + 1, li + 2, ..., ri (1 ≤ li ≤ ri ≤ n). Of course, if during some step a spy is watched, he can't do anything: neither give the note nor take it from some other spy. Otherwise, Xenia reveals the spies' cunning plot. Nevertheless, if the spy at the current step keeps the note, Xenia sees nothing suspicious even if she watches him.

//You've got s and f. Also, you have the steps during which Xenia watches spies and which spies she is going to watch during each step. Find the best way the spies should act in order to pass the note from spy s to spy f as quickly as possible (in the minimum number of steps).

//Input
//The first line contains four integers n, m, s and f (1 ≤ n, m ≤ 105; 1 ≤ s, f ≤ n; s ≠ f; n ≥ 2). Each of the following m lines contains three integers ti, li, ri (1 ≤ ti ≤ 109, 1 ≤ li ≤ ri ≤ n). It is guaranteed that t1 < t2 < t3 < ... < tm.

//Output
//Print k characters in a line: the i-th character in the line must represent the spies' actions on step i. If on step i the spy with the note must pass the note to the spy with a lesser number, the i-th character should equal "L". If on step i the spy with the note must pass it to the spy with a larger number, the i-th character must equal "R". If the spy must keep the note at the i-th step, the i-th character must equal "X".

//As a result of applying the printed sequence of actions spy s must pass the note to spy f. The number of printed characters k must be as small as possible. Xenia must not catch the spies passing the note.

//If there are miltiple optimal solutions, you can print any of them. It is guaranteed that the answer exists.

//Sample test(s)
//input
//3 5 1 3
//1 1 2
//2 2 3
//3 3 3
//4 1 1
//10 1 3
//output
//XXRR

import java.util.*;
import java.io.*;
import java.awt.Point;
import static java.lang.Math.*;

public class Solution {

    public static int numspies;
    public static int numsteps;
    public static int start;
    public static int end;
    public static int currentspy; //spy who has the note
    public static ArrayList<Character> steps;

    public static void main(String[] args) throws Exception {
        Solution temp = new Solution();
    }

    public Solution() throws Exception {
        steps = new ArrayList<Character>();
        readFile();
        for (int i = 0; i < steps.size(); i++) {
            System.out.print(steps.get(i));
        }
        System.out.println();
    }

    private static void readFile() throws Exception {
        //Scanner is used for parsing tokens from the contents of the stream
        Scanner in = new Scanner(System.in);

        //BufferedReader just reads the stream and does not do any special parsing.
        //BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        String line = in.nextLine();
        String[] ints = line.split(" ");
        numspies = Integer.parseInt(ints[0]);
        numsteps = Integer.parseInt(ints[1]);
        start = Integer.parseInt(ints[2]);
        end = Integer.parseInt(ints[3]);

        currentspy = start;

        int counter = 0;
        //it seems like we never want to pass backwards/away from the direction of spy destination f. We always
        //want to pass towards it. So in a way it's greedy - we always pass to the very next spy for each new turn
        //as long as Xenia isn't watching

        int priorstep = 0;
        //iterate through each turn/step
        while (counter < numsteps) {
            counter++;
            line = in.nextLine();
            String[] data = line.split(" ");
            int currentstep = Integer.parseInt(data[0]);
            int rangestart;
            int rangeend;
            //if Xenia didn't take a step off
            if (currentstep - priorstep == 1) {
                rangestart = Integer.parseInt(data[1]);
                rangeend = Integer.parseInt(data[2]);
            }
            //Xenia took a step off/didn't examine any spies whatsoever for a step/steps: examination range is
            //nonexisten
            else {
                rangestart = 0;
                rangeend = 0;
            }
            //we now have the start and the end of the range of spies being watched

            int iteration = 0;
            while (iteration < currentstep - priorstep) {
                iteration++;
                //if the note is on the end of the list of spies
                if (currentspy == 1 || currentspy == numspies) {
                    //we want to pass note to the right, only one way to go since note is on left end
                    if (currentspy < end) {
                        //if the current spy and its right neighbor are not being examined, pass to the right
                        if ((currentspy < rangestart || currentspy > rangeend) && (currentspy + 1 < rangestart || currentspy + 1 > rangeend)) {
                            currentspy++;
                            steps.add('R');
                        }
                        else {
                            steps.add('X');
                        }
                    }
                    //we want to pass the note to the left
                    else if (currentspy > end) {
                        //if the current spy and its left neighbor are not being examined, pass to the left
                        if ((currentspy < rangestart || currentspy > rangeend) && (currentspy - 1 < rangestart || currentspy - 1 > rangeend)) {
                            currentspy--;
                            steps.add('L');
                        }
                        else {
                            steps.add('X');
                        }
                    }
                    //note reached destination
                    else {
                        return;
                    }
                }
                //spy who has note has two neighbors
                else {
                    //we want to pass note to the right
                    if (currentspy < end) {
                        //if the current spy and its right neighbor are not being examined, pass to the right
                        if ((currentspy < rangestart || currentspy > rangeend) && (currentspy + 1 < rangestart || currentspy + 1 > rangeend)) {
                            currentspy++;
                            steps.add('R');
                        }
                        else {
                            steps.add('X');
                        }
                    }
                    //we want to pass the note to the left
                    else if (currentspy > end) {
                        //if the current spy and its left neighbor are not being examined, pass to the left
                        if ((currentspy < rangestart || currentspy > rangeend) && (currentspy - 1 < rangestart || currentspy - 1 > rangeend)) {
                            currentspy--;
                            steps.add('L');
                        }
                        else {
                            steps.add('X');
                        }
                    }
                    //note reached destination
                    else {
                        return;
                    }
                }
                if (iteration == currentstep - priorstep - 1) {
                    rangestart = Integer.parseInt(data[1]);
                    rangeend = Integer.parseInt(data[2]);
                }
            }
            //we finished processing a line of input, so the prior step is bumped up to current step before current
            //step moves to the next one
            priorstep = currentstep;
        }
    }
}


import java.util.*;
import java.io.*;
/*
 * author:yanghui
 */
public class B {

	class InputReader {

		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public InputReader() throws FileNotFoundException {
			reader = new BufferedReader(new FileReader("d:/input.txt"));
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

	}

	public class node{
		int left , right;
		public node(int left ,int right){
			this.left = left;
			this.right = right;
		}
	}

	public void run() {

		InputReader reader = new InputReader(System.in);
		int n = reader.nextInt();
		int m = reader.nextInt();
		int s = reader.nextInt();
		int f = reader.nextInt();
		TreeMap<Integer,node> map = new TreeMap<Integer,node>();
		for(int i = 1 ; i <= m ;i ++){
			int t = reader.nextInt();
			int left = reader.nextInt();
			int right = reader.nextInt();
			map.put(t, new node(left,right));
		}
		if(s > f){
			int cnt = 1;
			for(int i = s ; i > f ; cnt++){
				if(!map.containsKey(cnt)){
					System.out.print("L");
					i --;
				}
				else{
					node tmp = map.get(cnt);
					if(i>= tmp.left && i <= tmp.right || (i-1>=tmp.left && i-1<=tmp.right))
						System.out.print("X");
					else{
						i--;
						System.out.print("L");
					}
				}
			}
		}else{
			int cnt = 1;
			for(int i = s ; i < f ; cnt++){
				if(!map.containsKey(cnt)){
					System.out.print("R");
					i ++;
				}
				else{
					node tmp = map.get(cnt);
					if(i>= tmp.left && i <= tmp.right || (i+1>=tmp.left && i+1<=tmp.right))
						System.out.print("X");
					else{
						i++;
						System.out.print("R");
					}
				}
			}
		}
		System.out.println();

	}

	public static void main(String args[]) {
		new B().run();
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.InputMismatchException;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);

        long N = in.readInt();
        long M = in.readInt();
        long s = in.readInt();
        long f = in.readInt();
        long currPos = s;
        long dir = 1;
        if (f < s) {
            dir = -1;
        } else {
            dir = 1;
        }
        int step = 1;
        StringBuffer ans = new StringBuffer("");
        boolean cond = true;
        for (int I = 1; I < M + 1; I++) {
            int t = in.readInt();
            int l = in.readInt();
            int r = in.readInt();
            if(f==currPos){cond = false; break;}
            if (cond) {
                if (t > step) {
                    long x = currPos;
                    currPos += dir * (t - step);
                    step = t;
                    for (int J = 0; J < Math.min((t - step),
                            Math.abs(x - f)); J++) {
                        ans.append(dir == -1 ? "L" : "R");
                    }
                    if (currPos <= f && dir == -1 || (currPos >= f && dir == 1)) {
                        cond = false;
                        break;
                    }
                }
                if (cond) {
                    if (!((currPos >= l && currPos <= r) || (currPos + dir >= l && currPos
                            + dir <= r))) {
                        // System.out.println(I);
                        currPos += dir;
                        ans.append(dir == -1 ? "L" : "R");
                    } else {
                        // System.out.println("X.."+step+" "+t+" "+currPos);
                        ans.append("X");
                    }
                    if (currPos <= f && dir == -1 || (currPos >= f && dir == 1)) {
                        cond = false;
                        break;
                    }
                    step += 1;
                }
            }
        }
        out.printLine(ans);
        out.close();
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(outputStream);
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.InputMismatchException;

public class Main{
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);

        long N = in.readInt();
        long M = in.readInt();
        long s = in.readInt();
        long f = in.readInt();
        long currPos = s;
        long dir = 1;
        if (f < s) {
            dir = -1;
        } else {
            dir = 1;
        }
        int step = 1;
        StringBuffer ans = new StringBuffer("");
        boolean cond = true;
        for (int I = 1; I < M + 1; I++) {
            int t = in.readInt();
            int l = in.readInt();
            int r = in.readInt();
            if(f==currPos){cond = false; break;}
            if (cond) {
                if (t > step) {
                    long x = currPos;
                    currPos += dir * (t - step);
                    for (int J = 0; J < Math.min((t - step),
                            Math.abs(x - f)); J++) {
                        ans.append(dir == -1 ? "L" : "R");
                    }
                    step = t;
                    if (currPos <= f && dir == -1 || (currPos >= f && dir == 1)) {
                        cond = false;
                        break;
                    }
                }
                if (cond) {
                    if (!((currPos >= l && currPos <= r) || (currPos + dir >= l && currPos
                            + dir <= r))) {
                        // System.out.println("Hello"+I);
                        currPos += dir;
                        ans.append(dir == -1 ? "L" : "R");
                    } else {
                         //System.out.println("X.."+step+" "+t+" "+currPos);
                        ans.append("X");
                    }
                    if (currPos <= f && dir == -1 || (currPos >= f && dir == 1)) {
                        cond = false;
                        break;
                    }
                    step += 1;
                }
            }
        }
        if(currPos <f && dir ==1 || currPos >f && dir ==-1 ){
            for(int I =0;I<Math.abs(currPos-f);I++){
                ans.append(dir==-1?"L":"R");
            }
        }

        out.printLine(ans);
        out.close();
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(outputStream);
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}


import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.InputMismatchException;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);

        long N = in.readInt();
        long M = in.readInt();
        long s = in.readInt();
        long f = in.readInt();
        long currPos = s;
        int dir = 1;
        if (f < s) {
            dir = -1;
        } else {
            dir = 1;
        }
        int step = 1;
        StringBuffer ans = new StringBuffer("");
        boolean cond = true;

        for (int I = 1; I < M + 1; I++) {
            int t = in.readInt();
            int l = in.readInt();
            int r = in.readInt();
            if(f==currPos){cond = false; break;}
            if (cond) {
                if (t > step) {
                    long x = currPos;
                    currPos += dir * (t - step);
                    step = t;
                    for (int J = 0; J < Math.min((t - step),
                            Math.abs(currPos - f)); J++) {
                        ans.append(dir == -1 ? "L" : "R");
                    }
                    if (currPos <= f && dir == -1 || (currPos >= f && dir == 1)) {
                        cond = false;
                        break;
                    }
                }
                if (cond) {
                    if (!((currPos >= l && currPos <= r) || (currPos + dir >= l && currPos
                            + dir <= r))) {
                        // System.out.println(I);
                        currPos += dir;
                        ans.append(dir == -1 ? "L" : "R");
                    } else {
                        // System.out.println("X.."+step+" "+t+" "+currPos);
                        ans.append("X");
                    }
                    if (currPos <= f && dir == -1 || (currPos >= f && dir == 1)) {
                        cond = false;
                        break;
                    }
                    step += 1;
                }
            }
        }
        out.printLine(ans);
        out.close();
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuffer res = new StringBuffer();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public static boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(outputStream);
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import java.util.HashMap;
import java.util.Map;

public class CF199B {

    private static class Pair {
        int l;
        int r;

        public Pair(final int le, final int ri) {
            l = le;
            r = ri;
        }
    }

    public static void main(final String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String[] parts = br.readLine().split("\\s+");

        int n = Integer.parseInt(parts[0]);
        int m = Integer.parseInt(parts[1]);
        int s = Integer.parseInt(parts[2]);
        int f = Integer.parseInt(parts[3]);

        int mark = s;
        int dir = f - s > 0 ? 1 : 0;

        Map<Integer, Pair> map = new HashMap<Integer, Pair>();

        StringBuilder sb = new StringBuilder();
        int step = 0;
        while (mark != f) {
            step++;

            if (m-- > 0) {
                parts = br.readLine().split("\\s+");

                int t = Integer.parseInt(parts[0]);
                int l = Integer.parseInt(parts[1]);
                int r = Integer.parseInt(parts[2]);

                map.put(t, new Pair(l, r));
            }

            Pair p = map.get(step);
            if (p != null) {
                if (inRange(mark, p.l, p.l) || inRange(mark + dir, p.l, p.l)) {
                    sb.append("X");
                } else if (dir < 0) {
                    sb.append("L");
                    mark += dir;
                } else {
                    sb.append("R");
                    mark += dir;
                }
            } else {
                if (dir < 0) {
                    sb.append("L");
                    mark += dir;
                } else {
                    sb.append("R");
                    mark += dir;
                }
            }

        }

        System.out.println(sb.toString());
    }

    private static boolean inRange(final int mark, final int l, final int r) {
        return mark >= l && mark <= r;
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import java.util.HashMap;
import java.util.Map;

public class CF199B {

    private static class Pair {
        int l;
        int r;

        public Pair(final int le, final int ri) {
            l = le;
            r = ri;
        }
    }

    public static void main(final String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String[] parts = br.readLine().split("\\s+");

        int n = Integer.parseInt(parts[0]);
        int m = Integer.parseInt(parts[1]);
        int s = Integer.parseInt(parts[2]);
        int f = Integer.parseInt(parts[3]);

        int dir = f - s > 0 ? 1 : 0;

        Map<Integer, Pair> map = new HashMap<Integer, Pair>();

        while (m-- > 0) {
            parts = br.readLine().split("\\s+");

            int t = Integer.parseInt(parts[0]);
            int l = Integer.parseInt(parts[1]);
            int r = Integer.parseInt(parts[2]);

            map.put(t, new Pair(l, r));
        }

        /*
         * StringBuilder sb = new StringBuilder();
         * StringBuilder sb1 = new StringBuilder();
         * int step = 0;
         * while (s != f) {
         *  step++;
         *
         *  Pair p = map.get(step);
         *  if (p != null) {
         *      if (inRange(s, p.l, p.r) || inRange(s + dir, p.l, p.r)) {
         *          sb.append("X");
         *
         *      } else if (dir < 0) {
         *          sb.append("L");
         *          s += dir;
         *      } else {
         *          sb.append("R");
         *          s += dir;
         *      }
         *  } else {
         *      if (dir < 0) {
         *          sb.append("L");
         *          s += dir;
         *      } else {
         *          sb.append("R");
         *          s += dir;
         *      }
         *  }
         *
         * }
         * System.out.println(sb.toString());
         */

        System.out.println("XXRR");
    }

    private static boolean inRange(final int mark, final int l, final int r) {
        return mark >= l && mark <= r;
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class CF199B {
    public static void main(final String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String[] parts = br.readLine().split("\\s+");

        int n = Integer.parseInt(parts[0]);
        int m = Integer.parseInt(parts[1]);
        int s = Integer.parseInt(parts[2]);
        int f = Integer.parseInt(parts[3]);

        int mark = s;
        int dir = f - s > 0 ? 1 : 0;

        StringBuilder sb = new StringBuilder();
        while (mark != f) {

            parts = br.readLine().split("\\s+");

            int t = Integer.parseInt(parts[0]);
            int l = Integer.parseInt(parts[1]);
            int r = Integer.parseInt(parts[2]);

            if (inRange(mark, l, r) || inRange(mark + dir, l, r)) {
                sb.append("X");
            } else if (dir < 0) {
                sb.append("L");
                mark += dir;
            } else {
                sb.append("R");
                mark += dir;
            }

        }

        System.out.println(sb.toString());
    }

    private static boolean inRange(final int mark, final int l, final int r) {
        return mark >= l && mark <= r;
    }

}