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 result = []; function printShortestPath(n, i_start, j_start, i_end, j_end) { // Print the distance along with the sequence of moves. if(i_start > n || j_start > n || i_start < 0 || j_start < 0 || i_end > n || j_end > n || i_end < 0 || j_end < 0){ //Impossible result.push("Impossible"); return; } else if(i_start > i_end && j_start >= j_end){ // UL result.push("UL"); printShortestPath(n,i_start - 2,j_start - 1,i_end,j_end); return; } else if(i_start > i_end && j_start <= j_end){ //UR result.push("UR"); printShortestPath(n,i_start - 2,j_start + 1,i_end,j_end); return; } else if(i_start == i_end && j_start < j_end){ //R result.push("R"); printShortestPath(n,i_start,j_start + 2,i_end,j_end); return; } else if(i_start < i_end && j_start <= j_end){ //LR result.push("LR"); printShortestPath(n,i_start + 2,j_start + 1,i_end,j_end); return; } else if(i_start < i_end && j_start >= j_end){ //LL result.push("LL"); printShortestPath(n,i_start + 2,j_start - 1,i_end,j_end); return; } else if(i_start == i_end && j_start > j_end){ //L result.push("L"); printShortestPath(n,i_start,j_start - 2,i_end,j_end); return; } else if(i_start == i_end && j_start == j_end){ //match return; } else{ result.push("Impossible"); //Impossible return; } } 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); if(result.indexOf("Impossible") == -1){ console.log(result.length); var s = ""; for(var i = 0;i < result.length;i++){ s += result[i] + " "; } console.log(s); } else{ console.log("Impossible"); } }