process.stdin.resume(); process.stdin.setEncoding('ascii'); var input_stdin = ""; var input_stdin_array = ""; var input_currentline = 0; process.stdin.on('data', function (data) { input_stdin += data; }); process.stdin.on('end', function () { input_stdin_array = input_stdin.split("\n"); main(); }); function readLine() { return input_stdin_array[input_currentline++]; } /////////////// ignore above this line //////////////////// var moves = ""; var count = 0; // Print the distance along with the sequence of moves. function printShortestPath(n, i_start, j_start, i_end, j_end) { if (i_start == i_end && j_start == j_end ) { // MATCH! console.log(count); console.log(moves); } else { var rowDiff = i_end - i_start; var colDiff = j_end - j_start; // Knight will never land on an alteranate row if (rowDiff % 2 !== 0 ) { console.log("Impossible"); } // Go Up else if (rowDiff < 0) { if (colDiff < 0) { moves += 'UL '; count++; i_start -= 2; j_start--; printShortestPath(n, i_start, j_start, i_end, j_end); } else if (colDiff >= 0) { moves += 'UR '; count++; i_start -= 2; j_start++; printShortestPath(n, i_start, j_start, i_end, j_end); } } // Go Down else if (rowDiff > 0) { if (colDiff >= 0) { moves += 'LR '; count++; i_start += 2; j_start++; printShortestPath(n, i_start, j_start, i_end, j_end); } else if (colDiff < 0) { moves += 'LL '; count++; i_start += 2; j_start--; printShortestPath(n, i_start, j_start, i_end, j_end); } } // Go Horizontal else if (rowDiff == 0) { if (colDiff % 2 !== 0) { console.log("Impossible"); } // Right else if (colDiff > 0) { moves += 'R'; count++; j_start += 2; printShortestPath(n, i_start, j_start, i_end, j_end); } // left else if (colDiff < 0) { moves += 'L '; count++; j_start -= 2; printShortestPath(n, i_start, j_start, i_end, j_end); } } } } // ends function function main() { var n = parseInt(readLine()); var i_start_temp = readLine().split(' '); var i_start = parseInt(i_start_temp[0]); var j_start = parseInt(i_start_temp[1]); var i_end = parseInt(i_start_temp[2]); var j_end = parseInt(i_start_temp[3]); printShortestPath(n, i_start, j_start, i_end, j_end); }