#!/bin/python3 import sys, math # UL, UR, R, LR, LL, L def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. if(i_start%2 != i_end%2): print("Impossible") return list = "" aux = 0 while i_start != i_end and aux < n**2: if(i_start > i_end): if(j_start >= j_end): list +="UL" i_start -=2 j_start -=1 else: list += "UR" i_start -=2 j_start +=1 else: if(j_start>j_end): list +="LL" i_start +=2 j_start -=1 else: list += "LR" i_start +=2 j_start +=1 list += " " aux+=1 if(aux>=n): print("Impossible") return aux = 0 while(j_start != j_end) and aux < n**2: list += "R" if j_start < j_end else "L" j_start += 2 if j_start < j_end else -2 list += " " aux +=1 if(aux>=n): print("Impossible") return print(list[:-1].split(" ").__len__()) print(list[:-1]) 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)