#include #include #include #include #include #include #include void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. static int count=0,i=0; static char c[200]; if(count==0) { if(abs(i_start-i_end)%2!=0) printf("Impossible"); } else { if(i_end > i_start) { i_start+=2; c[i]='L'; i++; if(j_end >= j_start) { j_start++; c[i]='R'; i++; c[i]=' '; i++; } else if(j_end < j_start) { j_start--; c[i]='L'; i++; c[i]=' '; i++; } } else if(i_end < i_start) { i_start-=2; c[i]='U'; i++; if(j_end > j_start) { j_start++; c[i]='R'; i++; c[i]=' '; i++; } else if(j_end <= j_start) { j_start--; c[i]='L'; i++; c[i]=' '; i++; } } else { if(j_end > j_start) { j_start+=2; c[i]='R'; i++; c[i]=' '; i++; } else if(j_end < j_start) { j_start-=2; c[i]='L'; i++; c[i]=' '; i++; } } } count++; if(!(i_start==i_end && j_start==j_end) && abs(i_start-i_end)%2==0) printShortestPath(n, i_start, j_start, i_end, j_end); else if(abs(i_start-i_end)%2==0) { printf("%d\n",count-1); printf("%s",c); } } int main() { int n; scanf("%i", &n); int i_start; int j_start; int i_end; int j_end; scanf("%i %i %i %i", &i_start, &j_start, &i_end, &j_end); printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }