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 j_start, int i_end, int j_end) { String path[]=new String[200]; int k=0; if(i_start>i_end) { if((i_start-i_end)%2==0) { int rem=(i_start-i_end)/2; if(j_start==j_end) { if(rem%2==0) { int i,j_start_copy=j_start; for(i=1;i<=rem/2;i++) { if((j_start_copy)>0) { path[k]="UL"; k++; j_start_copy--; } else { break; } } int j; for(j=i;jj_end) { for(l=0;l<(j_start_copy-j_end)/2;l++) { path[k]="L"; k++; } } System.out.println(k); display(path,k); } else { System.out.println("Impossible"); } } } else { System.out.println("Impossible"); } } else if(j_start>j_end) { int i,j_start_copy=j_start; for(i=1;i<=rem;i++) { if(j_start_copy>0) { if(j_start_copy>j_end) { path[k]="UL"; k++; j_start_copy--; } else if(j_start_copyj_end) { for(int l=0;l<(j_start_copy-j_end)/2;l++) { path[k]="L"; k++; } } else if(j_end>j_start_copy) { for(int l=0;l<(j_end-j_start_copy)/2;l++) { path[k]="R"; k++; } } System.out.println(k); display(path,k); } else System.out.println("Impossible"); } } else if(j_startj_end) { for(int l=0;l<(j_start_copy-j_end)/2;l++) { path[k]="L"; k++; } } else if(j_start_copyi_start) { if((i_end-i_start)%2==0) { int rem=(i_end-i_start)/2; if(j_start==j_end) { if(rem%2==0) { int i,j,j_start_copy=j_start; for(i=1;i<=rem/2;i++) { if(j_start_copy0) { path[k]="LL"; k++; j_start_copy--; } else break; } if(jj_end) { for(int l=0;l<(j_start_copy-j_end)/2;l++) { path[k]="L"; k++; } } else if(j_start_copyj_end) { int i,j,j_start_copy=j_start; for(i=1;i<=rem;i++) { if(j_start_copy>j_end) { path[k]="LL"; k++; j_start_copy--; } else break; } if(ij_start) { if(j_end-j_start%2==0) { int rem=(j_end-j_start)/2; System.out.println(rem); for(int i=0;ij_end) { if(j_start-j_end%2==0) { int rem=(j_start-j_end)/2; System.out.println(rem); for(int i=0;i