import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int mat[][]; static boolean visited[][]; static Queue que; static int n,i_end,j_end; static boolean found; static class matrix{ int row; int col; String key; matrix(int row,int col,String key){ this.row=row; this.col=col; this.key=key; } } public static void main(String[] args) { Scanner in = new Scanner(System.in); n = in.nextInt(); int r = in.nextInt(); int c= in.nextInt(); i_end = in.nextInt(); j_end = in.nextInt(); found=false; que=new LinkedList<>(); mat=new int[n][n]; visited=new boolean[n][n]; recursive(r,c,""); while(!found){ try{ matrix mx=que.remove(); recursive(mx.row,mx.col,mx.key); //print(); } catch(Exception e){ System.out.println("Impossible"); found=true; } } } static void recursive(int r,int c,String k){ int row[]=new int[]{0,0,-2,-2,2,2}; int col[]=new int[]{-2,2,-1,1,-1,1}; String key[]=new String[]{"L","R","UL","UR","LL","LR"}; Map map=new HashMap<>(); map.put("L",1); map.put("LL",2); map.put("LR",3); map.put("R",4); map.put("UR",5); map.put("UL",6); for(int i=0;imap.get(arr[ki])){ String temp=arr[j]; arr[j]=arr[ki]; arr[ki]=temp; } } } for(int j=arr.length-1;j>=1;j--){ System.out.print(arr[j]+" "); } break; } matrix mx=new matrix(r+row[i],c+col[i],s); que.add(mx); } } } static void print(){ for(matrix mx:que){ System.out.print(mx.row+" "); System.out.print(mx.col); System.out.println(mx.key); } System.out.println("-----------------"); } static boolean is_Safe(int r,int c){ if(r=0 && c=0){ if(visited[r][c]!=true){ visited[r][c]=true; return true; } } return false; } }