import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; import static java.util.Arrays.binarySearch; import static java.util.stream.IntStream.range; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.NumberFormat; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int x = in.nextInt(); int y = in.nextInt(); int p = in.nextInt(); int q = in.nextInt(); String pos = checkPosition(x,y,p,q); ArrayList a = new ArrayList(); boolean f = false; while(true){ if(x<0 || y<0 || y>n-1 || x>n-1) break; if(pos.equals("UL")){ y--; x-=2; a.add("UL"); } else if(pos.equals("UR")){ y++; x-=2; a.add("UR"); } else if(pos.equals("R")){ if(q==y+1) break; y+=2; a.add("R"); } else if(pos.equals("LR")){ y++; x+=2; a.add("LR"); } else if(pos.equals("LL")){ y--; x+=2; a.add("LL"); } else if(pos.equals("L")){ if(q==y-1) break; y-=2; a.add("L"); } else if(pos.equals("U")){ if(p==x-1) break; y--; x-=2; a.add("UL"); } else if(pos.equals("D")){ if(p==x+1) break; y++; x+=2; a.add("LR"); } if(x==p && y==q){ f = true; break; } pos = checkPosition(x,y,p,q); } if(!f) System.out.println("Impossible"); else{ System.out.println(a.size()); for(int i=0; iy) return "R"; else return "L"; } else if(y==q){ if(x>p) return "U"; else return "D"; } else{ if(x>p && y>q) return "UL"; else if(x>p && yq) return "LL"; else if(x