#include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int i = i_end - i_start; int j = j_end - j_start; if ( i % 2 != 0 ) { cout << "Impossible" << endl; return ; } if ( i % 4 == 0 ) { if ( j % 2 == 1 || j % 2 == -1 ) { cout << "Impossible" << endl; return ; } } if ( i % 4 == 2 || i % 4 == -2 ) { if ( j % 2 == 0 ) { cout << "Impossible" << endl; return ; } } int count = 0; int ul=0, ur=0, l=0, ll=0, lr=0, r=0; while ( i != 0 ) { if ( i < 0 ) { if ( j <= 0 ) { count++; ul++; i += 2; j += 1; } else { ur++; count++; i += 2; j -= 1; } } else { if ( j >= 0 ) { lr++; count++; i -= 2; j -= 1; } else { ll++; count++; i -= 2; j += 1; } } } while ( j != 0 ) { if ( j < 0 ) { l++; count++; j += 2; } else { r++; count++; j -= 2; } } cout << count << endl; while ( ul-- != 0 ) cout << "UL " ; while ( ur-- != 0 ) cout << "UR " ; while ( r-- != 0 ) cout << "R " ; while ( lr-- != 0 ) cout << "LR "; while ( ll-- != 0 ) cout << "LL " ; while ( l-- != 0 ) cout << "L " ; } 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; }