#!/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, UR, R, LR, LL, L i_next_move = i_start j_next_move = j_start ul = [-2, -1] ur = [-2, 1] r = [0, 2] lr = [2, 1] ll = [2, -1] l = [0, -2] move_steps = [ul, ur, r, lr, ll, l] move_steps_name = ['UL', 'UR', 'R', 'LR', 'LL', 'L'] moves_taken = [] while True: all_moves = [] all_moves_name = [] selected_move = [] selected_move_name = '' for idx,step in enumerate(move_steps): i = step[0] + i_next_move j = step[1] + j_next_move if (i > (n - 1) or j > (n - 1)) or (i < 0 or j < 0 ) : continue all_moves = all_moves + [[i, j]] all_moves_name = all_moves_name + [move_steps_name[idx]] # if destination matches select move and break if i == i_end and j == j_end : selected_move = [i, j] selected_move_name = move_steps_name[idx] break; if len(selected_move) <= 0 : selected_move = all_moves[0] selected_move_name = all_moves_name[0] i_next_move = selected_move[0] j_next_move = selected_move[1] moves_taken = moves_taken + [selected_move_name] if (i_next_move == i_end) and (j_next_move == j_end): break print(len(moves_taken)) print(' '.join(moves_taken)) 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)