#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. # priority: UL, UR, R, LR, LL, L. def is_valid(p): if 0 <= p[0] < n and 0 <= p[1] < n: return True return False from collections import deque B = [[-1]*n for _ in range(n)] q = deque() start = (i_start, j_start) q.append(start) B[i_start][j_start] = -2 moves = [(-2,-1), (-2,1),(0,2),(2,1),(2,-1),(0,-2)] moves_str = ["UL", "UR", "R", "LR", "LL", "L"] while q: p = q.popleft() for i, move in enumerate(moves): new_p = (p[0]+move[0], p[1]+move[1]) if is_valid(new_p) and (B[new_p[0]][new_p[1]] == -1): B[new_p[0]][new_p[1]] = i if new_p == (i_end, j_end): q = [] break q.append(new_p) if B[i_end][j_end] != -1: i, j = i_end, j_end results = [] while i != i_start or j != j_start: idx = B[i][j] results.append(moves_str[idx]) i -= moves[idx][0] j -= moves[idx][1] print (len(results)) results.reverse() print (" ".join(results)) else: 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)