{$mode objfpc} {$coperators on} const fi='input.txt'; fo='output.txt'; maxn=205; dx:array[1..6] of longint=(-2,-2,0,2,2,0); dy:array[1..6] of longint=(-1,1,2,1,-1,-2); procedure fileio; begin assign(input,fi); reset(input); assign(output,fo); rewrite(output); end; type data=record x,y:longint; end; var trace,d:array[-2..maxn,-2..maxn] of longint; q:array[0..maxn*maxn] of data; st:array[0..maxn*maxn] of longint; s,f:data; n:longint; procedure enter; begin readln(n); readln(s.x,s.y,f.x,f.y); inc(s.x); inc(s.y); inc(f.x); inc(f.y); end; procedure BFS; var l,r,i,j:longint; u,v:data; begin fillchar(trace,sizeof(trace),255); for i:=1 to n do for j:=1 to n do trace[i][j]:=0; trace[s.x][s.y]:=-1; l:=1; r:=1; q[1]:=s; repeat u:=q[l]; inc(l); for i:=1 to 6 do begin v.x:=u.x+dx[i]; v.y:=u.y+dy[i]; if trace[v.x][v.y]=0 then begin d[v.x][v.y]:=d[u.x][u.y]+1; trace[v.x][v.y]:=i; inc(r); q[r]:=v; end; end; until l>r; end; procedure solve; var i,top:longint; begin BFS; top:=0; if trace[f.x][f.y]=0 then writeln('Impossible') else begin while (f.x<>s.x) or (F.y<>s.y) do begin inc(top); st[top]:=trace[f.x][f.y]; f.x-=dx[st[top]]; f.y-=dy[st[top]]; end; writeln(top); for i:=top downto 1 do case st[i] of 1: write('UL '); 2: write('UR '); 3: write('R '); 4: write('LR '); 5: write('LL '); 6: write('L '); end; end; end; begin //fileio; enter; solve; end.