#include using namespace std; 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. vector path; bool val = true; int UL[2]={-1,-2}; int UR[2]={1,-2}; int L[1]={-2}; int R[1]={2}; int LL[2]={-1,2}; int LR[2]={1,2}; int temp; while(i_start!=i_end && j_start!=j_end || val==true){ if(i_start+UL[1]==i_end && j_start+UL[0]==j_end){ i_start+=UL[1]; j_start+=UL[0]; path.push_back("UL"); break; } else if(i_start+UR[1]==i_end && j_start+UR[0]==j_end){ i_start+=UR[1]; j_start+=UR[0]; path.push_back("UR"); break; } else if(i_start+LL[1]==i_end && j_start+LL[0]==j_end){ i_start+=LL[1]; j_start+=LL[0]; path.push_back("LL"); break; } else if(i_start+LR[1]==i_end && j_start+LR[0]==j_end){ i_start+=LR[1]; j_start+=LR[0]; path.push_back("LR"); break; } // cout << " hey" << endl; while(i_starti_end && j_start!=j_end && (j_start+1!=j_end && j_start-1!=j_end)){ i_start+=UL[1]; j_start+=UL[0]; path.push_back("UL"); if(i_start<0 || j_start<0){ cout << "Impossible"; return; } //cout << j_start << " " << i_start << endl; } //cout << "sigh" << endl; //cout << j_start << " " << i_start << endl; while(i_start>i_end && j_start!=j_end && (j_start+1==j_end || j_start-1==j_end)){ i_start+=LL[1]; j_start+=LL[0]; path.push_back("LL"); //cout << "hey" << endl; if(i_start<0 || j_start<0){ cout << "Impossible"; return; } //cout << j_start << " " << i_start << endl; } while(i_starti_end && j_start!=j_end && (j_start+1==j_end || j_start-1==j_end)){ i_start+=LR[1]; j_start+=LR[0]; path.push_back("LR"); if(i_start<0 || j_start<0){ cout << "Impossible"; return; } //cout << j_start << " " << i_start << endl; } while(i_startj_end){ path.clear(); path.push_back("Impossible"); val = false; break; } } else if(j_start>j_end){ j_start+=L[0]; path.push_back("L"); //cout << "here " << j_start << endl; if(j_starti_end){ path.clear(); path.push_back("Impossible"); val = false; break; } } else if(i_start>i_end){ temp = j_start; j_start+=UL[0]; i_start+=UL[1]; path.push_back("UL"); if(i_start> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }