using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ String[] move = new String[]{"UL", "UR", "R", "LR", "LL", "L"}; int[] dx = new int[]{-1, 1, 2, 1,-1,-2}; int[] dy = new int[]{-2,-2, 0, 2, 2, 0}; int[][] b = new int[N][]; int[][] m = new int[N][]; for(int i=0;i Q = new Queue(); b[r0][c0] = 0; Q.Enqueue(r0 * N + c0); while(Q.Count>0){ var now = Q.Dequeue(); int r = now / N; int c = now % N; for(int t=0;t<6;t++){ int nr = r + dy[t]; int nc = c + dx[t]; if(!InRange(nr, 0, N) || !InRange(nc, 0, N)) continue; if(b[nr][nc] <= b[r][c] + 1) continue; b[nr][nc] = b[r][c] + 1; m[nr][nc] = t; Q.Enqueue(nr * N + nc); } } if(m[r1][c1] == -1){ Console.WriteLine("Impossible"); return; } List ans = new List(); int rr = r1, cc = c1; while(m[rr][cc] != -1){ ans.Add(m[rr][cc]); rr -= dy[ans[ans.Count -1]]; cc -= dx[ans[ans.Count -1]]; } Console.WriteLine(ans.Count); ans.Reverse(); Console.WriteLine(String.Join(" ",ans.Select(t => move[t]))); } bool InRange(int t, int l, int r){ return l <= t && t < r; } int N; int r0,c0,r1,c1; public Sol(){ N = ri(); var d = ria(); r0 = d[0]; c0 = d[1]; r1 = d[2]; c1 = d[3]; } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);} static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }