import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static void printShortestPath(int n, int i_start, int i_end, int j_start, int j_end) { // Print the distance along with the sequence of moves. ArrayList s = new ArrayList(); boolean flag = false; if(i_start < j_start && i_end < j_end) { while(i_start != j_start || i_end != j_end) { if(i_start+2 <= j_start && i_end+1 <= j_end) { s.add("LR"); i_start = i_start+2; i_end = i_end + 1; } else if(i_start==j_start && i_end+2 <= j_end) { s.add("R"); i_end = i_end + 2; } else if(i_start==j_start && i_end-2 <=j_end ) { s.add("L"); i_end = i_end - 2; } else if(i_start+2 <= j_start && i_end-1 <= j_end) { s.add("LL"); i_start = i_start+2; i_end = i_end - 1; } else { flag = true; break; } } } else if(i_start > j_start && i_end > j_end) { while(i_start != j_start || i_end != j_end) { if(i_start-2 >= j_start && i_end+1 <= j_end) { s.add("UR"); i_start = i_start-2; i_end = i_end + 1; } else if(i_start==j_start && i_end+2 <= j_end) { s.add("R"); i_end = i_end + 2; } else if(i_start==j_start && i_end-2 >=j_end ) { s.add("L"); i_end = i_end - 2; } else if(i_start-2 >= j_start && i_end-1 >= j_end) { s.add("UL"); i_start = i_start-2; i_end = i_end - 1; } else { flag = true; break; } //System.out.println(i_start+" "+i_end); } } else if(i_start == j_start && i_end > j_end) { while(i_end != j_end) { if(i_start==j_start && i_end-2 <=j_end ) { s.add("L"); i_end = i_end - 2; } else { flag = true; break; } } } else if(i_start == j_start && i_end < j_end) { while(i_end != j_end) { if(i_start==j_start && i_end+2 <=j_end ) { s.add("R"); i_end = i_end + 2; } else { flag = true; break; } } } else if(i_start > j_start && i_end < j_end) { while(i_start != j_start || i_end != j_end) { if(i_start-2 >= j_start && i_end+1 <= j_end) { s.add("UR"); i_start = i_start-2; i_end = i_end + 1; } else if(i_start==j_start && i_end+2 <= j_end) { s.add("R"); i_end = i_end + 2; } else if(i_start==j_start && i_end-2 >=j_end ) { s.add("L"); i_end = i_end - 2; } else if(i_start-2 >= j_start && i_end-1 >= j_end) { s.add("UL"); i_start = i_start-2; i_end = i_end - 1; } else { flag = true; break; } } } else if(i_start < j_start ) { while(i_start != j_start || i_end != j_end) { if(i_start+2 <= j_start && i_end != j_end) { s.add("LL"); i_start = i_start+2; i_end = i_end - 1; } else if(i_start+2 <= j_start ) { s.add("LR"); i_start = i_start+2; i_end = i_end + 1; } else if(i_start==j_start && i_end+2 <= j_end) { s.add("R"); i_end = i_end + 2; } else if(i_start==j_start && i_end-2 <=j_end ) { s.add("L"); i_end = i_end - 2; } else { flag = true; break; } } } if(flag == false) { System.out.println(s.size()); for(int i=0;i