#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. # Run a bfs level = [(i_start, j_start)] move = {} parent = {(i_start, j_start): None} #options = {'UL': (-2, -1), 'UR': (-2, 1), 'L': (0, -2), 'R': (0, 2), 'LL': (2, -1), 'LR': (2, 1)} options = [('UL', (-2, -1)), ('UR', (-2, 1)), ('R', (0, 2)), ('LR', (2, 1)), ('LL', (2, -1)), ('L', (0, -2))] #UL, UR, R, LR, LL, L n_level = 0 while level: new_level = [] for i, j in level: if i == i_end and j == j_end: # print the output print(n_level) moves = [] curr = (i_end, j_end) while curr in move: moves.append(move[curr]) curr = parent[curr] print(' '.join(moves[::-1])) return None else: # Push all unvisited neighbors for key, value in options: di, dj = value new_i, new_j = i + di, j + dj if 0 <= new_i < n and 0 <= new_j < n and (new_i, new_j) not in parent: new_level.append((new_i, new_j)) parent[(new_i, new_j)] = (i, j) move[(new_i, new_j)] = key level = new_level n_level += 1 print('Impossible') 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)