#include #include #include #include #include #include #include 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); int i = 0,j = 0,k = 0,l = 0 ,count = 0,m,n1; char str[n][3]; while(i_start < n && i_start >= 0) { while(j_start < n && j_start >= 0) { if(i_start < i_end && j_start < j_end){ count++; strcpy(str[k],"DR "); i_start = i_start+2; j_start = j_start+1; k++; } else if(i_start < i_end && j_start > j_end) { count++; strcpy(str[k],"DL "); i_start = i_start+2; j_start = j_start-1; k++; } else if(j_start < j_end && i_start > i_end) { count++; strcpy(str[k],"UR "); i_start = i_start-2; j_start = j_start+1; k++; } else if(j_start > j_end && i_start > i_end) { count++; strcpy(str[k],"UL "); i_start =i_start-2; j_start = j_start-1; k++; } else if(i_start ==i_end && j_start > j_end) { count++; strcpy(str[k],"L "); //start =i_start-2; j_start = j_start-2; k++; } else if(i_start ==i_end && j_start < j_end) { count++; strcpy(str[k],"R "); //start =i_start-2; j_start = j_start+2; k++; } else if(j_start == j_end && j_start<1 &&i_start>i_end) { count++; strcpy(str[k],"DR"); i_start =i_start-2; j_start = j_start+1; k++; } else if(j_start == j_end && j_starti_end) { count++; strcpy(str[k],"DL"); i_start =i_start-2; j_start = j_start-1; k++; } else if(j_start == j_end && j_start<1 &&i_start n) { j=1; break; } } if(j!=0) break; } if(i_start==i_end&&j_start==j_end) { printf("%d\n",count); for(m = 0; m < k ; m++) { for(n1= 0; n1< 2 ;n1++) { printf("%c",str[m][n1]); } printf(" "); } } else printf("Impossible"); return 0; }