#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. # UL (1 left, 2 up), UR (1 right, 2 up), R (2 right), LR (1 right, 2 down), LL (1 left, 2 down), L (2 left) if abs(i_end - i_start) < 2 and abs(j_end - j_start) < 2: print('Impossible') return if (abs(j_end - j_start)%2 == 0 and j_end != j_start) or abs(i_end - i_start)%2 != 0: print('Impossible') return num_moves = 0 span = '' # i - rows # j - cols # j j j #i| . . . #i| . . . # i_start 0 # j_start 3 4 # i_end 4 # j_end 3 while i_end != i_start or j_end != j_start: if i_end - i_start == 0: # side only: if j_end - j_start > 0: # right span = ' '.join([span, 'R']) j_start += 2 else: # left span = ' '.join([span, 'L']) j_start -= 2 elif i_end - i_start < 0: # up if j_end - j_start == 0: # double move case if j_start != 0: span = ' '.join([span, 'UL']) j_start -= 1 else: span = ' '.join([span, 'UR']) j_start += 1 elif j_end - j_start < 0: # up-left span = ' '.join([span, 'UL']) j_start -= 1 else: # up-right span = ' '.join([span, 'UR']) j_start += 1 i_start -= 2 else: # down if j_end - j_start == 0: # double move case if j_start != n - 1: span = ' '.join([span, 'LR']) j_start += 1 else: span = ' '.join([span, 'LL']) j_start -= 1 elif j_end - j_start < 0: # down-left span = ' '.join([span, 'LL']) j_start -= 1 else: # down-right span = ' '.join([span, 'LR']) j_start += 1 i_start += 2 num_moves += 1 print(num_moves) print(span.strip()) 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)