#include using namespace std; #define ll long long #define MOD 1000000007 #define sc(n) scanf("%d",&n) #define scl(n) scanf("%lld",&n) #define p(n) printf("%d",&n) #define fi first #define sec second #define mp make_pair #define pb1 push_back #define pb push int a[1000005]; bool vis[201][201]; pair parent[201][201]; string dir[201][201]; int si,sj,di,dj,n; int y[6] = {-1,1,2,1,-1,-2}; int x[6] = {-2,-2,0,2,2,0}; string type(int i) { if(i == 0){ return "UL"; } if(i == 1){ return "UR"; } if(i == 2){ return "R"; } if(i == 3){ return "LR"; } if(i == 4){ return "LL"; } else{ return "L"; } } bool bfs(int si,int sj) { vis[si][sj] = true; queue< pair >q; q.pb({si,sj}); int nx,ny,i; while(!q.empty()){ auto pi = q.front(); if(pi.fi == di && pi.sec == dj){ return true; } q.pop(); for(i = 0;i < 6;i++){ nx = pi.fi + x[i]; ny = pi.sec + y[i]; if(nx < 0 || ny < 0 || nx >= n || ny >= n){ continue; } if(vis[nx][ny] == true){ continue; } vis[nx][ny] = true; parent[nx][ny] = {pi.fi,pi.sec}; dir[nx][ny] = type(i); q.pb({nx,ny}); } } return false; } vectordire; void rec(int i,int j) { if(i == si && j == sj){ return; } rec(parent[i][j].fi,parent[i][j].sec); dire.pb1(dir[i][j]); } int main() { int i,j,k,l,m,t,r,cnt; int flag; ll ans,an; cin >> n; cin >> si >> sj >> di >> dj; if(bfs(si,sj)){ rec(di,dj); cout << (int)dire.size() << endl; for(i = 0;i < dire.size();i++){ cout << dire[i] << " "; } cout << endl; } else{ cout << "Impossible" << endl; } }