#!/bin/python3 import sys move = {'UL': (-2, -1, 0), 'UR': (-2, 1, 1), 'R': (0, 2, 2), 'LR': (2, 1, 3), 'LL': (2, -1, 4), 'L': (0, -2, 5)} def reorder(moves): return sorted(moves, key=lambda x:move[x][2]) def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. if abs(i_start - i_end) % 2: print('Impossible') return if (j_start - j_end) % 2 - ((i_start - i_end) / 2) % 2 != 0: print('Impossible') return moves = [] i_curr = i_start j_curr = j_start # First, move vertically while i_curr < i_end: # go down if j_curr <= j_end: key = 'LR' else: key = 'LL' moves += [key] i_curr += move[key][0] j_curr += move[key][1] while i_curr > i_end: # go up if j_curr >= j_end: key = 'UL' else: key = 'UR' moves += [key] i_curr += move[key][0] j_curr += move[key][1] # And move horizontally while j_curr > j_end: key = 'L' moves += [key] i_curr += move[key][0] j_curr += move[key][1] while j_curr < j_end: key = 'R' moves += [key] i_curr += move[key][0] j_curr += move[key][1] moves = reorder(moves) print(len(moves)) print(' '.join(moves)) 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)