#!/bin/python3 import sys import math def calculate_distance(i_start, j_start, i_end, j_end): return abs(i_end - i_start)**2 + abs(j_end - j_start)**2 def still_in_bound(n, i_start, j_start, move_i, move_j): return i_start + move_i > -1 and i_start + move_i < n and \ j_start + move_j > -1 and j_start + move_j < n def should_move(current_distance, query, path, target): return current_distance > calculate_distance(query[1]+path[1], query[2]+path[2], target[0], target[1]) def printShortestPath(n, i_start, j_start, i_end, j_end): result = ['Impossible'] if abs(i_end - i_start)%2 != 1: queries = [([],i_start, j_start)] possible_path = [('UL',-2,-1), ('UR',-2,1), ('R',0,2), ('LR',2,1), ('LL',2,-1), ('L',0,-2)] while len(queries) > 0: query = queries.pop() distance = calculate_distance(query[1], query[2], i_end, j_end) if distance == 0: result = query[0] break elif calculate_distance(query[1], query[2], i_end, j_end) <= 2: pass else: next_path = [path for path in possible_path \ if still_in_bound(n, query[1], query[2], path[1], path[2]) and \ should_move(distance, query, path, (i_end, j_end))] for path in next_path: queries.insert(0, (query[0]+[path[0]], query[1]+path[1], query[2]+path[2])) if result[0] != 'Impossible': print(len(result)) 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)