#!/bin/python3 import sys def printSteps(steps): print(len(steps)) for step in steps: print(step, end = " ") def computeRoute(n, i_start, j_start, i_end, j_end): steps = [] pos_y = i_start pos_x = j_start while (pos_x != j_end or pos_y != i_end): if (pos_y > i_end and pos_x >= j_end): steps.append("UL") pos_y -= 2 pos_x -= 1 elif (pos_y > i_end and pos_x < j_end): steps.append("UR") pos_y -= 2 pos_x += 1 elif (pos_y == i_end and pos_x > j_end): steps.append("L") pos_x -= 2 elif (pos_y == i_end and pos_x < j_end): steps.append("R") pos_x += 2 elif (pos_y < i_end and pos_x > j_end): steps.append("LL") pos_y += 2 pos_x -= 1 elif (pos_y < i_end and pos_x <= j_end): steps.append("LR") pos_y += 2 pos_x += 1 printSteps(steps) def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. mod = (i_start - i_end) % 4 mod_x = (j_start - j_end) % 2 steps = [] pos_y = i_start pos_x = j_start if (mod == 1 or mod == 3): print("Impossible") elif (mod == 2): if (mod_x == 0): print("Impossible") else: computeRoute(n, i_start, j_start, i_end, j_end) elif (mod == 0): if (mod_x == 1): print("Impossible") else: computeRoute(n, i_start, j_start, i_end, j_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)