import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static class Move { String _name; int _xMove; int _yMove; Move(String name, int x, int y) { _name = name; _xMove = x; _yMove = y; } } static int rootI; static int rootJ; static int dis; static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { rootI = i_start; rootJ = j_start; dis = (int) (Math.pow((rootI - i_end),2) + Math.pow((rootJ - j_end),2)); // Step1 : build the directions List moves = createMove(i_start, j_start, i_end, j_end); List res = new ArrayList<>(); dfs(new boolean[n][n], i_start, j_start, i_end, j_end, moves, new ArrayList<>(), res); if (res.size() == 0) { System.out.println("Impossible"); } else { System.out.println(res.size()); String prefix = ""; for (String str : res) { System.out.print(prefix + str); prefix = " "; } } } static boolean overRange(int cur_i, int cur_j) { return dis < (Math.pow((rootI - cur_i), 2) + Math.pow((rootJ - cur_j), 2)); } static void dfs(boolean[][] table, int i_start, int j_start, int i_end, int j_end, List moves, List ansBuilder, List res) { int n = table.length; if (i_start < 0 || i_start >= n || j_start < 0 || j_start >= n || table[i_start][j_start] == true || overRange(i_start, j_start) || res.size() > 0) {//(res.size() > 0 && ansBuilder.size() >= res.size())) { return; } if (i_start == i_end && j_start == j_end) { if (res.size() == 0 || res.size() > ansBuilder.size()) { res.clear(); res.addAll(ansBuilder); } return; } table[i_start][j_start] = true; for (int i = 0; i < moves.size(); i++) { int i_next = i_start + moves.get(i)._xMove; int j_next = j_start + moves.get(i)._yMove; ansBuilder.add(moves.get(i)._name); dfs(table, i_next, j_next, i_end, j_end, moves, ansBuilder, res); ansBuilder.remove(ansBuilder.size() - 1); } table[i_start][j_start] = false; } static List createMove(int i_start, int j_start, int i_end, int j_end) { // UL, UR, R, LR, LL, L. // Move[] moves = new Move[6]; List moves = new ArrayList<>(); if (i_start == i_end) { if (j_start < j_end) { moves.add(new Move("R", 0, 2)); } else { moves.add(new Move("L", 0, -2)); } } else if (i_start < i_end) { if (j_start == j_end) { moves.add(new Move("LR", 2, 1)); moves.add(new Move("LL", 2, -1)); } else if (j_start < j_end){ moves.add(new Move("R", 0, 2)); moves.add(new Move("LR", 2, 1)); } else { moves.add(new Move("LL", 2, -1)); moves.add(new Move("L", 0, -2)); } } else { if (j_start == j_end) { // do noting moves.add(new Move("UL", -2, -1)); moves.add(new Move("UR", -2, 1)); } else if (j_start < j_end){ moves.add(new Move("UR", -2, 1)); moves.add(new Move("R", 0, 2)); } else { moves.add(new Move("UL", -2, -1)); moves.add(new Move("L", 0, -2)); } } /*moves[0] = new Move("UL", -2, -1); moves[1] = new Move("UR", -2, 1); moves[2] = new Move("R", 0, 2); moves[3] = new Move("LR", 2, 1); moves[4] = new Move("LL", 2, -1); moves[5] = new Move("L", 0, -2);*/ return 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(); } }