import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static String path[][]; static void printPath(int i, int j, int i_start, int j_start) { if(i == i_start && j == j_start) { return; } int xm[] = {2, 2, 0, -2, -2, 0}; int ym[] = {1, -1, -2, -1, 1, 2}; String m[] = {"UL", "UR", "R", "LR", "LL", "L"}; for(int k = 0; k < 6; ++k) { if(path[i][j].equals(m[k])) { printPath(i+xm[k], j+ym[k], i_start, j_start); System.out.print(m[k] + " "); } } } static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { boolean visited[][] = new boolean[n][n]; path = new String [n][n]; int i[] = new int[n*n]; int j[] = new int[n*n]; int count[] = new int[n*n]; int qh = 0; int qt = 0; i[qh] = i_start; j[qh] = j_start; count[qh++] = 0; visited[i_start][j_start] = true; int xm[] = {-2, -2, 0, 2, 2, 0}; int ym[] = {-1, 1, 2, 1, -1, -2}; String m[] = {"UL", "UR", "R", "LR", "LL", "L"}; while(qt < qh) { int i_ = i[qt]; int j_ = j[qt]; int count_ = count[qt++]; if(i_ == i_end && j_ == j_end) { System.out.println(count_); printPath(i_, j_, i_start, j_start); return; } for(int k = 0; k < 6; ++k) { int in = i_ + xm[k]; int jn = j_ + ym[k]; if(in >= 0 && in < n && jn >= 0 && jn < n) { if(!visited[in][jn]) { i[qh] = in; j[qh] = jn; count[qh++] = count_ + 1; visited[in][jn] = true; path[in][jn] = m[k]; } } } } System.out.println("Impossible"); } 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(); } }