#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end, path=[]): # Print the distance along with the sequence of moves. if i_start==i_end and j_start==j_end: print(len(path)) print(*path) if (i_start-i_end)%2==1: print("Impossible") elif (i_start-i_end)%4==0 and (j_start-j_end)%2==1: print("Impossible") elif (i_start-i_end)%4==2 and (j_start-j_end)%2==0: print("Impossible") else: if i_start>i_end: if j_start >= j_end: path.append("UL") printShortestPath(n, i_start-2, j_start-1, i_end, j_end, path) else: path.append("UR") printShortestPath(n, i_start-2, j_start+1, i_end, j_end, path) elif i_start==i_end and j_startj_end: path.append("L") printShortestPath(n, i_start, j_start-2, i_end, j_end, path) if __name__ == "__main__": size = 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(size, i_start, j_start, i_end, j_end)