import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; import javafx.util.*; public class Solution { Pair parent[][]; static void printShortestPath(int n, int si, int sj, int ei, int ej) { Pair parent[][]=new Pair[1+n][1+n]; for(int i=0;i<=n;i++){ for(int j=0;j<=n;j++) parent[i][j]=new Pair(-1,-1); } boolean visited[][]=new boolean[1+n][1+n]; Queue> q=new LinkedList>(); q.add(new Pair(si,sj)); int flag=0; Pair last=new Pair(ei,ej); while(!q.isEmpty()){ // System.out.println(q); Pair temp=q.remove(); int a=(int)temp.getKey(); int b=(int)temp.getValue(); visited[a][b]=true; int arr[][]={{-2,-1},{-2,1},{0,2},{2,1},{2,-1},{0,-2}}; for(int i=0;i<6;i++){ int l=a+arr[i][0]; int m=b+arr[i][1]; if(l>=0&&l<=n&&m>=0&&m<=n) { Pair next=new Pair(l,m); if(!visited[l][m]) { visited[l][m]=true; parent[l][m]=temp; q.add(next); if(next.equals(last)) flag=1; } } } if(flag==1) break; } Stack> ans=new Stack>(); int c=0; if(flag==0) System.out.println("Impossible"); else{while((int)last.getKey()!=si||(int)last.getValue()!=sj){ ans.push(last); int x=(int)last.getKey(); int y=(int)last.getValue(); Pair p=parent[x][y]; last=new Pair(p.getKey(),p.getValue()); c++; } System.out.println(c); int x=si; int y=sj; while(!ans.isEmpty()){ Pair temp=ans.pop(); //System.out.println(temp+" "+x+""+y); int a=(int)temp.getKey(); int b=(int)temp.getValue(); if(a-x==0&&b-y==2) System.out.print("R "); else if(a-x==0&&b-y==-2) System.out.print("L "); else if(a-x==2&&b-y==1) System.out.print("LR "); else if(a-x==-2&&b-y==1) System.out.print("UR "); else if(a-x==-2&&b-y==-1) System.out.print("UL "); else System.out.print("LL "); x=a; y=b; } }// Print the distance along with the sequence of moves. } 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(); } }