#include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { if((i_end - i_start) % 2 != 0){ cout << "Impossible"; } if((i_end - i_start) == 0 && (j_end - j_start) & 2 != 0){ cout << "Impossible"; } std::vector moves; int count = 0; while(abs(i_end - i_start) > 0){ if(i_end > i_start){ if(j_end < j_start){ moves.push_back("LL"); j_start += -1; i_start += 2; count++; } else { moves.push_back("LR"); j_start += 1; i_start += 2; count++; } } else if (i_end < i_start){ if(j_end < j_start){ moves.push_back("UL"); j_start += -1; i_start += -2; count++; } else { moves.push_back("UR"); j_start += 1; i_start += -2; count++; } } } while(abs(j_end - j_start) > 0){ if(j_end < j_start){ moves.push_back("L"); j_start += -2; count++; } else { moves.push_back("R"); j_start += 2; count++; } } cout << count << endl; for(int i = 0; i < moves.size(); i++){ cout << moves[i] << " "; } // Print the distance along with the sequence of moves. } 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; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }