import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static String path = ""; static int path_length = 0; static int arr[] = new int[6]; // UL-0 UR-1 R-2 LR-3 LL-4 L-5 static String str[] = {"UL","UR","R","LR","LL","L"}; static boolean possible = true; 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 x1 = i_start, x2 = i_end; int y1 = j_start, y2 = j_end; // (x1,y1) => (x2,y2) int vd = Math.abs(x1-x2), hd = Math.abs(y1-y2); if(vd%2==1){ possible = false; return; } if(vd==0 && hd==0){ possible = true; return; } if(vd==0){ // Right or Left. if(hd%2==1){ possible = false; return; }else{ if(y1>y2){ // Left arr[5]++;//path += "L "; path_length++; printShortestPath(n,x1,y1-2,x2,y2); }else{ // Right arr[2]++;//path += "R "; path_length++; printShortestPath(n,x1,y1+2,x2,y2); } } } else if(x1>x2 && y1>y2){ // UL. arr[0]++;//path += "UL "; path_length++; printShortestPath(n,x1-2,y1-1,x2,y2); } else if(x1>x2 && y1y2){ // LL. arr[4]++;//path += "LL "; path_length++; printShortestPath(n,x1+2,y1-1,x2,y2); }else if(x1x2){ // UL. arr[0]++;//path += "UL "; path_length++; printShortestPath(n,x1-2,y1-1,x2,y2); }else{ // LR. arr[3]++;//path += "LR "; path_length++; printShortestPath(n,x1+2,y1+1,x2,y2); } } } 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); if(possible){ System.out.println(path_length); //System.out.println(path); for(int i=0;i<6;i++){ if(arr[i]>0){ for(int j=0;j