import java.io.*; import java.util.*; import javafx.util.Pair; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { ArrayList> went = new ArrayList>(); int max = Math.abs(j_start-j_end) + Math.abs(i_start+i_end); Queue, ArrayList>> q = new LinkedList, ArrayList>>(); Pair cords = new Pair(i_start, j_start); q.add(new Pair( cords, new ArrayList())); while(!q.isEmpty()){ Pair ij = q.peek().getKey(); ArrayList arr = q.remove().getValue(); if(went.contains(ij)||arr.size()> max || ij.getKey() < 0 || ij.getKey() >= n || ij.getValue() < 0 || ij.getValue() >= n){ } else{ went.add(ij); if(ij.getKey() == i_end && ij.getValue() == j_end){ System.out.println(arr.size()); for(int k = 0; k < arr.size(); k++){ if(k != 0){ System.out.print(" "); } System.out.print(arr.get(k)); } return; } ArrayList arr2 = ((ArrayList)arr.clone()); arr2.add("UL"); q.add(new Pair(new Pair(ij.getKey()-2, ij.getValue()-1), arr2)); arr2 = ((ArrayList)arr.clone()); arr2.add("UR"); q.add(new Pair(new Pair(ij.getKey()-2, ij.getValue()+1), arr2)); arr2 = ((ArrayList)arr.clone()); arr2.add("R"); q.add(new Pair(new Pair(ij.getKey(), ij.getValue()+2), arr2)); arr2 = ((ArrayList)arr.clone()); arr2.add("LR"); q.add(new Pair(new Pair(ij.getKey()+2, ij.getValue()+1), arr2)); arr2 = ((ArrayList)arr.clone()); arr2.add("L"); q.add(new Pair(new Pair(ij.getKey(), ij.getValue()-2), arr2)); arr2 = ((ArrayList)arr.clone()); arr2.add("LL"); q.add(new Pair(new Pair(ij.getKey()+2, ij.getValue()-1), arr2)); } } System.out.print("Impossible"); } public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int i_start = in.nextInt(); int j_start = in.nextInt(); int i_end = in.nextInt(); int j_end = in.nextInt(); printShortestPath(n, i_start, j_start, i_end, j_end); in.close(); } }