import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. int count = 0; while(j_end!=j_start && i_end!=i_start) { if((i_start + 2 || j_start+2) > n || (i_start - 2 || j_start-2) < 0) { System.out.println} if(j_end < j_start && i_end < i_start) //UPPER LEFT MOVE { j_start = j_start-1; i_start = i_start -2; System.out.print(" "+"UL"); count++; } if(j_end > j_start && i_end < i_start) //UPPER RIGHT MOVE { j_start = j_start+1; i_start = i_start -2; System.out.print(" "+"UR"); count++; } if(j_end < j_start && i_end > i_start) //LOWER LEFT { j_start = j_start-1; i_start = i_start + 2; System.out.print(" "+"LL"); count++; } if(j_end > j_start && i_end > i_start) //LOWER RIGHT { j_start = j_start+1; i_start = i_start + 2; System.out.print(" "+"LR"); count++; } if(j_end < j_start && i_end == i_start) //LEFT MOVE { j_start = j_start-2; i_start = i_start; System.out.print(" "+"L"); count++; } if(j_end > j_start && i_end == i_start) //RIGHT MOVE { j_start = j_start+2; i_start = i_start; System.out.print(" "+"R"); count++; } } System.out.println(count); } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int i_start = in.nextInt(); int j_start = in.nextInt(); int i_end = in.nextInt(); int j_end = in.nextInt(); printShortestPath(n, i_start, j_start, i_end, j_end); in.close(); } }