#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. y_steps = i_end - i_start # print(i_start, i_end, y_steps, y_steps % 2) if y_steps % 2 != 0: print("Impossible") return num_v_steps = abs(y_steps) // 2 x_steps = j_end - j_start num_h_steps = abs(x_steps) - num_v_steps # if the remaining horizontal gap # can be made up by horizontal movements. if num_h_steps % 2 != 0: print("Impossible") return num_h_steps = num_h_steps // 2 # now it's doable. if num_h_steps <= 0: # back and forth. print(num_v_steps) # number of steps to walk back num_cancel = (num_v_steps - abs(x_steps)) // 2 if y_steps > 0: # down for _ in range(num_cancel): print("LR", end=" ") print("LL", end=" ") if x_steps > 0: # right for _ in range(num_v_steps - 2 * num_cancel): print("LR", end=" ") return elif x_steps == 0: return else: # left for _ in range(num_v_steps - 2 * num_cancel): print("LL", end=" ") elif y_steps == 0: return else: # up for _ in range(num_cancel): print("UR", end=" ") print("UL", end=" ") if x_steps > 0: # right for _ in range(num_v_steps - 2 * num_cancel): print("UR", end=" ") return elif x_steps == 0: return else: # left for _ in range(num_v_steps - 2 * num_cancel): print("UL", end=" ") return # no wasted moves else: print(num_v_steps + num_h_steps) if y_steps > 0: # going down if x_steps > 0: # to the right for _ in range(num_v_steps): print("LR", end=" ") for _ in range(num_h_steps): print("R", end=" ") elif x_steps == 0: raise Exception("can't happen") else: # to the left for _ in range(num_v_steps): print("LL", end=" ") for _ in range(num_h_steps): print("L", end=" ") elif y_steps == 0: # no vertical mvt. if x_steps > 0: # to the right for _ in range(num_h_steps): print("R", end=" ") elif x_steps == 0: raise Exception("can't happen") else: # to the left for _ in range(num_h_steps): print("L", end= " ") else: # going up if x_steps > 0: # to the right for _ in range(num_v_steps): print("UR", end=" ") for _ in range(num_h_steps): print("R", end=" ") elif x_steps == 0: raise Exception("can't happen") else: # to the left for _ in range(num_v_steps): print("UL", end=" ") for _ in range(num_h_steps): print("L", end=" ") 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)