#!/bin/python3 import sys def printShortestPath(n, endCords, knightCords, moves, count): if(knightCords[0] < 0 or knightCords[1] < 0 or knightCords[0] >= n or knightCords[1] >= n): print("Impossible") elif((knightCords[0] > endCords[0] and knightCords[1] > endCords[1]) or (knightCords[0] == endCords[0] and knightCords[1] > endCords[1])): moves.append("UL") knightCords[0] -= 1 knightCords[1] -= 2 count += 1 printShortestPath(n, knightCords, endCords, moves, count) elif(knightCords[0] < endCords[0] and knightCords[1] > endCords[1]): moves.append("UR") knightCords[0] += 1 knightCords[1] -= 2 count += 1 printShortestPath(n, knightCords, endCords, moves, count) elif((knightCords[0] > endCords[0] and knightCords[1] < endCords[1]) or (knightCords[0] == endCords[0] and knightCords[1] < endCords[1])): moves.append("LL") knightCords[0] -= 1 knightCords[1] += 2 count += 1 printShortestPath(n, knightCords, endCords, moves, count) elif(knightCords[0] < endCords[0] and knightCords[1] < endCords[1]): moves.append("LR") knightCords[0] += 1 knightCords[1] += 2 count += 1 printShortestPath(n, knightCords, endCords, moves, count) elif(knightCords[0] > endCords[0]): moves.append("L") knightCords[0] -= 2 count += 1 printShortestPath(n, knightCords, endCords, moves, count) elif(knightCords[0] < endCords[0]): moves.append("R") knightCords[0] += 2 count += 1 printShortestPath(n, knightCords, endCords, moves, count) elif(knightCords[0] == endCords[0] and knightCords[1] == endCords[1]): print(count) for i in moves: print(i, end=" ") else: print("Impossible") 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, [j_start, i_start], [j_end, i_end], [], 0)