import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static class Point { int i; int j, step, prev; String dir; Point(int i, int j, int s, String dir, int prev) { this.i = i; this.j = j; this.step = s; this.dir = dir; this.prev = prev; } } static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. int[][] matrix = new int[n][n]; for (int i=0; i al = new ArrayList<>(); al.add(new Point(i_start, j_start, 0, "", -1)); matrix[i_start][j_start] = 1; int i = 0; while (i1 && curJ>0 && matrix[curI-2][curJ-1]==0) { al.add(new Point(curI-2, curJ-1, i, "LU", i)); matrix[curI-2][curJ-1] = 1; } if (curI>1 && curJ0 && matrix[curI+2][curJ-1]==0) { al.add(new Point(curI+2, curJ-1, i, "LL", i)); matrix[curI+2][curJ-1] = 1; } if (curJ>1 && matrix[curI][curJ-2]==0) { al.add(new Point(curI, curJ-2, i, "L", i)); matrix[curI][curJ-2] = 1; } i++; } 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(); } }