#!/bin/python import sys def printShortestPath(n, i_start, j_start, i_end, j_end): # Print the distance along with the sequence of moves. if (i_start - i_end) % 2 != 0: print 'Impossible' elif (i_start - i_end) % 4 == 0 and (j_start - j_end) % 2 != 0: print 'Impossible' elif (i_start - i_end) % 4 != 0 and (j_start - j_end) % 2 != 1: print 'Impossible' else: nextStep(n, i_start, j_start, i_end, j_end, []) def nextStep(n, i_start, j_start, i_end, j_end, steps): #print i_start, i_end, j_start, j_end if i_start > i_end and j_start >= j_end and i_start-2 >= 0 and j_start-1 >= 0: steps.append('UL') #print steps, '----------- UL' nextStep(n, i_start-2, j_start-1, i_end, j_end, steps) elif i_start > i_end and j_start < j_end and i_start-2 >= 0 and j_start+1 <= n: steps.append('UR') #print steps, '----------- UR' nextStep(n, i_start-2, j_start+1, i_end, j_end, steps) elif i_start == i_end and j_start < j_end and j_start+2 <= n: steps.append('R') #print steps, '----------- R' nextStep(n, i_start, j_start+2, i_end, j_end, steps) elif i_start < i_end and j_start <= j_end and i_start+2 <= n and j_start+1 <= n: steps.append('LR') #print steps, '----------- LR' nextStep(n, i_start+2, j_start+1, i_end, j_end, steps) elif i_start < i_end and j_start > j_end and i_start+2 <= n and j_start-1 >= 0: steps.append('LL') #print steps, '----------- LL' nextStep(n, i_start+2, j_start-1, i_end, j_end, steps) elif i_start == i_end and j_start > j_end and j_start-2 >= 0: steps.append('L') #print steps, '----------- L' nextStep(n, i_start, j_start-2, i_end, j_end, steps) else: print len(steps) print ' '.join(map(str, steps)) if __name__ == "__main__": n = int(raw_input().strip()) i_start, j_start, i_end, j_end = raw_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)