import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static boolean isPossible(int i_start, int j_start, int i_end, int j_end) { boolean possible = false; if( Math.abs(i_start-i_end)%4 == 0 ) { if( Math.abs(j_start-j_end)%2 == 0 ) possible = true; } else if( Math.abs(i_start-i_end)%4 == 2) { if( Math.abs(j_start-j_end)%2 == 1) possible = true; } return possible; } static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // i = y // j = x boolean possible = isPossible(i_start,j_start,i_end,j_end); // Print the distance along with the sequence of moves. if(possible) { Deque path = new ArrayDeque<>(); boolean done = false; while(!done) { if(i_end < i_start) { // y_end < y_start if(j_end<=j_start) { path.add("UL"); i_start += -2; j_start += -1; } else { path.add("UR"); i_start += -2; j_start += 1; } } else if(i_end == i_start) { // y_end == y_start if(j_endj_start) { path.add("R"); j_start += 2; } } else if(i_end>i_start) { // y_end > y_start if(j_end>=j_start) { path.add("LR"); i_start += 2; j_start += 1; } else if(j_end