import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { 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(); bfs(n, i_start, j_start, i_end, j_end); in.close(); } static void bfs(int n, int i_start, int j_start, int i_end, int j_end) { int[] di = {-2, -2, 0, 2, 2, 0}; int[] dj = {-1, 1, 2, 1, -1, -2}; String[] move = {"UL", "UR", "R", "LR", "LL", "L"}; Move[][] board = new Move[n][n]; board[i_start][j_start] = new Move("", 0); Queue queue = new LinkedList<>(); queue.offer(new Pos(i_start, j_start)); boolean found = false; while (!queue.isEmpty()) { Pos next = queue.poll(); if (next.i == i_end && next.j == j_end) { found = true; break; } for (int x = 0; x < 6; x++) { int newI = next.i + di[x]; int newJ = next.j + dj[x]; if (newI >= 0 && newJ >= 0 && newI < n && newJ < n && board[newI][newJ] == null) { board[newI][newJ] = new Move(move[x], board[next.i][next.j].step + 1); queue.offer(new Pos(newI, newJ)); } } } if (!found) { System.out.println("Impossible"); } else { ArrayList path = new ArrayList<>(); Pos curr = new Pos(i_end, j_end); for (int i = board[i_end][j_end].step; i >= 0; i--) { path.add(board[curr.i][curr.j]); switch (board[curr.i][curr.j].dir) { case "L": curr = new Pos(curr.i, curr.j + 2); break; case "R": curr = new Pos(curr.i, curr.j - 2); break; case "UL": curr = new Pos(curr.i + 2, curr.j + 1); break; case "UR": curr = new Pos(curr.i + 2, curr.j - 1); break; case "LL": curr = new Pos(curr.i - 2, curr.j + 1); break; case "LR": curr = new Pos(curr.i - 2, curr.j - 1); break; } } System.out.println(board[i_end][j_end].step); for (int i = path.size() - 2; i > 0; i--) System.out.print(path.get(i).dir + " "); System.out.println(path.get(0).dir); } } static class Pos { int i, j; Pos(int i, int j) { this.i = i; this.j = j; } } static class Move { String dir; int step; Move (String d, int s) { dir = d; step = s; } } }