directions = { 'UL': (-2, -1), 'UR': (-2, 1), 'R': (0, 2), 'LR': (2, 1), 'LL': (2, -1), 'L': (0, -2) } def is_reachable(start, target, N): if target[0] >= N or target[1] >= N: return False row_parity = start[0] % 2 if row_parity == target[0] % 2: row_diff = target[0] - start[0] col_diff = target[1] - start[1] return bool(row_diff % 4) == bool(col_diff % 2) return False def can_go(start, N, direction): target = (start[0] + directions[direction][0], start[1] + directions[direction][1]) return target[0] < N and target[1] < N def we(start, target): diff = (target[0] - start[0], target[1] - start[1]) for k,v in directions.items(): if v[0] == 0: if diff[0] == 0 and ((diff[1] > 0) == (v[1] > 0)): return True, int(diff[1] / v[1]), k elif ((diff[1] > 0) == (v[1] > 0)) and ((diff[0] > 0) == (v[0] > 0)): if diff[1] / v[1] == diff[0] / v[0]: return True, int(diff[1] / v[1]), k return False, 0, 0 if __name__ == '__main__': N = int(input()) position = list(map(int, input().split(' '))) start = tuple(position[:2]) target = tuple(position[2:]) if not is_reachable(start, target, N): print('Impossible') exit() path = [] while (start != target): direction = None end, multiplier, direction = we(start, target) if (end): path += [direction] * multiplier break # upper if target[0] < start[0]: if target[1] <= start[1] and can_go(start, N, 'UL'): direction = 'UL' else: direction = 'UR' elif target[1] > (start[1] + 1): direction = 'R' # lower elif target[0] > start[0]: if target[1] >= start[1] and can_go(start, N, 'LR'): direction = 'LR' else: direction = 'LL' # same else: direction = 'L' path.append(direction) start = (start[0] + directions[direction][0], start[1] + directions[direction][1]) print(len(path)) print(' '.join(path))