#!/bin/python3 def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. vertdist = i_end-i_start hordist = j_end-j_start # Print if it's impossible: if vertdist%2 == 1: print('Impossible') elif vertdist%4 == 2 and hordist%2 == 0: print('Impossible') elif vertdist%4 == 0 and hordist%2 == 1: print('Impossible') else: # Print the number of moves: vertmoves = int(abs(vertdist/2)) if abs(hordist) <= vertmoves: moves = vertmoves hormoves = 0 else: hormoves = int((abs(hordist)-vertmoves)/2) moves = vertmoves+hormoves print(int(moves)) # Construct the path. s = '' # If the motion is horizontal... if vertdist == 0: if hordist > 0: for i in range(hormoves): s += 'R ' elif hordist < 0: for i in range(hormoves): s += 'L ' # If the motion is up... elif vertdist < 0: # We will treat four cases separately. if abs(hordist) >= vertmoves: if hordist < 0: # case 1 for i in range(vertmoves): s += 'UL ' for i in range(hormoves): s += 'L ' else: # case 2 for i in range(vertmoves): s += 'UR ' for i in range(hormoves): s += 'R ' else: ulmoves = int((vertmoves-hordist)/2) urmoves = vertmoves-ulmoves if ulmoves <= j_start: # case 3 for i in range(ulmoves): s += 'UL ' for i in range(urmoves): s += 'UR ' else: # case 4 for i in range(j_start): s += 'UL ' for i in range(int((vertmoves-j_start)/2)): s += 'UR UL ' if (vertmoves-j_start)%2 == 1: s += 'UR ' # If the motion is down... elif vertdist > 0: # We will treat four cases separately. if abs(hordist) >= vertmoves: if hordist < 0: # case 1 for i in range(vertmoves): s += 'LL ' for i in range(hormoves): s += 'L ' else: # case 2 for i in range(hormoves): s += 'R ' for i in range(vertmoves): s += 'LR ' else: llmoves = int((vertmoves-hordist)/2) lrmoves = vertmoves-llmoves if lrmoves < n-j_start: # case 3 for i in range(lrmoves): s += 'LR ' for i in range(llmoves): s += 'LL ' else: # case 4 for i in range(n-j_start-1): s += 'LR ' for i in range(int((vertmoves-n+j_start+1)/2)): s += 'LL LR ' if (vertmoves-n+j_start+1)%2 == 1: s += 'LL ' # Print the path. print(s) 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)