#!/bin/python3 import sys def printShortestPath(n, y_start, x_start, y_end, x_end): # Print the distance along with the sequence of moves. moves = [] x = x_start y = y_start # Check if it's possible to reach destination line if (y_end - y) % 2 == 1: print("Impossible") return # Put the knight on the same line as the target while y != y_end: # if it's above if y < y_end: y += 2 #if it's at left or same column if x <= x_end: moves.append('LR') x += 1 #if it's at left else: moves.append('LL') x -= 1 # if it's below else: y -= 2 #if it's at right or same column if x >= x_end: moves.append('UL') x -= 1 #if it's at left else: moves.append('UR') x += 1 # Now that we are on the same line, check if it's possible to reach the target if (x_end - x) % 2 == 1: print("Impossible") return # Move horizontally to the target while x != x_end: #if it's at left if x < x_end: moves.append('R') x += 2 #if it's at right else: moves.append('L') x -= 2 print(len(moves)) print(' '.join(moves)) if __name__ == "__main__": n = int(input().strip()) i_start, j_start, i_end, j_end = input().strip().split(' ') i_start, j_start, i_end, j_end = [int(i_start), int(j_start), int(i_end), int(j_end)] printShortestPath(n, i_start, j_start, i_end, j_end)