#!/bin/python3 import sys move = [] my_own_order = ['UL', 'UR', 'R','LR','LL','L'] order = {key: i for i, key in enumerate(my_own_order)} def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. diff_i = i_end - i_start diff_j = j_end - j_start if diff_i ==0 and diff_j ==0: print (len(move)) print (" ".join(sorted(move, key=lambda d: order[d]))) return if diff_i % 2 !=0 : print ("Impossible") return else: if diff_i <0: if diff_j<=0: move.append("UL") printShortestPath(n, i_start - 2, j_start - 1, i_end, j_end) if diff_j>0: move.append("UR") printShortestPath(n, i_start - 2, j_start + 1, i_end, j_end) elif diff_i>0: if diff_j<0: move.append("LL") printShortestPath(n, i_start + 2, j_start - 1, i_end, j_end) if diff_j>=0: move.append("LR") printShortestPath(n, i_start + 2, j_start + 1, i_end, j_end) elif diff_i==0: if diff_j % 2 !=0: print ("Impossible") return else: if diff_j>0: move.append("R") printShortestPath(n, i_start , j_start +2, i_end, j_end) elif diff_j<0: move.append("L") printShortestPath(n, i_start , j_start -2, 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)