#include using namespace std; vector < string > path; int ct; int flage; void UR(int &i, int &j) { ct++; i = i - 2; j = j + 1; path.push_back("UR"); } void UL(int &i, int &j) { ct++; i = i - 2; j = j - 1; path.push_back("UL"); } void LR(int &i, int &j) { ct++; i = i + 2; j = j + 1; path.push_back("LR"); } void LL(int &i, int &j) { ct++; i = i + 2; j = j - 1; path.push_back("LL"); } void R(int &i, int &j) { ct++; j = j + 2; path.push_back("R"); } void L(int &i, int &j) { ct++; j = j - 2; path.push_back("L"); } 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 a = i_end - i_start; int b = j_end - j_start; int r = (b-(a/2))%2; if(a%2!=0 || r!=0) { cout << "Impossible" << endl; flage = 0; } else { flage = 1; if(a < 0) { //upper; if(b > 0) { //right; while(i_start != i_end) { UR(i_start, j_start); } while(j_start != j_end) { R(i_start, j_start); } } else if(b < 0) { //left; while(i_start != i_end) { UL(i_start, j_start); } while(j_start != j_end) { L(i_start, j_start); } } else { //same while(i_start != i_end) { UR(i_start, j_start); UL(i_start, j_start); } } } else if(a > 0) { //lower; if(b > 0) { //right; while(j_start != j_end) { R(i_start, j_start); } while(i_start != i_end) { LR(i_start, j_start); } } else if(b < 0) { //left; while(j_start != j_end) { L(i_start, j_start); } while(i_start != i_end) { LL(i_start, j_start); } } else { //same col while(i_start != i_end) { LR(i_start, j_start); LL(i_start, j_start); } } } else if( a == 0) { //same row; if(b > 0) { //right; while(j_start != j_end) { R(i_start, j_start); } } else if(b < 0) { //left; while(j_start != j_end) { L(i_start, j_start); } } } } } int main() { int n; cin >> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; ct = 0; printShortestPath(n, i_start, j_start, i_end, j_end); if(flage == 1) { cout << ct << endl; for(int i=0; i