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) { LinkedList list=new LinkedList(); list.add(new Pair(i_start,j_start)); Pair dest = new Pair(i_end,j_end); Pair s; boolean vis[][]=new boolean[n][n]; int dist[][]=new int[n][n]; String parent[][]=new String[n][n]; dist[i_start][j_start]=0; vis[i_start][j_start]=true; Pair pi[][]=new Pair[n][n]; while(list.size()!=0){ s = list.poll(); if(s.equals(dest)) break; //UL if((s.x-2)>=0 && (s.y-1)>=0 && !vis[s.x-2][s.y-1]){ list.add(new Pair(s.x-2,s.y-1)); dist[s.x-2][s.y-1]=dist[s.x][s.y]+1; vis[s.x-2][s.y-1]=true; parent[s.x-2][s.y-1]="UL"; pi[s.x-2][s.y-1]=s; } //UR if((s.x-2)>=0 && (s.y+1)=0 && !vis[s.x+2][s.y-1]){ list.add(new Pair(s.x+2,s.y-1)); dist[s.x+2][s.y-1]=dist[s.x][s.y]+1; vis[s.x+2][s.y-1]=true; parent[s.x+2][s.y-1]="LL"; pi[s.x+2][s.y-1]=s; } //L if((s.y-2)>=0 && !vis[s.x][s.y-2]){ list.add(new Pair(s.x,s.y-2)); dist[s.x][s.y-2]=dist[s.x][s.y]+1; vis[s.x][s.y-2]=true; parent[s.x][s.y-2]="L"; pi[s.x][s.y-2]=s; } } if(dist[dest.x][dest.y]==0){ System.out.println("Impossible"); return; } System.out.println(dist[dest.x][dest.y]); String res=""; int i,j; while(i_start!=i_end || j_start!=j_end){ //System.out.println(i_end+" "+j_end); res=parent[i_end][j_end]+" "+res; i=pi[i_end][j_end].x; j=pi[i_end][j_end].y; i_end=i; j_end=j; } System.out.println(res); } 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(); } } class Pair{ int x,y; Pair(int a,int b){ x=a; y=b; } public boolean equals(Pair p){ return this.x==p.x && this.y==p.y; } }