#!/bin/python3 import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. startp=(i_start,j_start) endp=(i_end, j_end) def canMove(move,start): canmove=None if move=='UL': if start[0]-2>=0 and start[0]-2<=n-1 and start[1]-1>=0 and start[1]-1<=n-1: canmove=(start[0]-2,start[1]-1) if move=='UR': if start[0]-2>=0 and start[0]-2<=n-1 and start[1]+1>=0 and start[1]+1<=n-1: canmove=(start[0]-2,start[1]+1) if move=='L': if start[1]-2>=0 and start[1]-2<=n-1: canmove=(start[0],start[1]-2) if move=='R': if start[1]+2>=0 and start[1]+2<=n-1: canmove=(start[0],start[1]+2) if move=='LL': if start[0]+2>=0 and start[0]+2<=n-1 and start[1]-1>=0 and start[1]-1<=n-1: canmove=(start[0]+2,start[1]-1) if move=='LR': if start[0]+2>=0 and start[0]+2<=n-1 and start[1]+1>=0 and start[1]+1<=n-1: canmove=(start[0]+2,start[1]+1) return canmove def distance(start,end): return abs(start[0]-end[0])+abs(start[1]-end[1]) pathDistance=distance(startp,endp) moves=['UL','UR','R','LR','LL','L'] #moves=[] #if startp[0]-endp[0]<0: # moves=['R','LL','LR','L'] #elif startp[0]-endp[0]>0: # moves=['UR','UL','R','L'] #else: # moves=['R','L'] path=[] min_distance=pathDistance current_point=startp while pathDistance>1: current_move=None min_distance=pathDistance for move in moves: pointd=canMove(move,startp) if pointd!=None: if distance(pointd,endp)0: print('Impossible') else: print(len(path)) print(" ".join(path)) 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)