#!/bin/python3 import sys # Print the distance along with the sequence of moves. def printShortestPath(n, i_start, j_start, i_end, j_end): #6 6 0 1 #i_start = 6 #j_start = 6 #i_end = 0 #j_end = 1 #num1 = 3 #dir1 = UL #num2 = 1 #dir2 = moves = 0 # In the y direction he can only move 2 at a time. If the start is even on the y, the end must be even on the y, and vica verca if i_start%2 != i_end%2: print('Impossible') return if j_start == j_end: #special case if(abs(i_start-i_end)%4 !=0): print('Impossible') else: num = abs(i_start-i_end)//4 if i_start < i_end: dir = 'LR LL' else: dir = 'UL UR' result = [] for i in range(num): result.append(dir) print(str(num*2)) print(' '.join(result)) return #How many UL, UR, LL, LRs? num1 = abs(i_start-i_end)//2 if i_start > i_end: dir1 = 'U' else: dir1 = 'L' if j_end < j_start: dir1 += 'L' else: dir1 += 'R' #How many Ls or Rs num2 = (abs(j_start-j_end) - num1) //2 if j_end < j_start: dir2 = 'L' else: dir2 = 'R' #Build result result = [] for i in range(num1): result.append(dir1) for i in range(num2): result.append(dir2) print(str(num1+num2)) print(' '.join(result)) 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)