#include #include #include #include #include using namespace std; //long int wholsum=0; int pos(int a, int b) { if(a > b) return (a-b); return (b-a); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n,ii,ji,il,jl,i,j,k,ye,arr[10005]={0}; cin>>n; cin>>ii>>ji>>il>>jl; if(ii%2 == 0) { if(il%2 != 0 ){ cout<<"Impossible"; return 0;} else { ye = pos(il,ii); ye = ye/2; if(ye%2 == 0) { if( (ji%2) != (jl%2) ){ cout<<"Impossible"; return 0;} } else { if( (ji%2) == (jl%2) ){ cout<<"Impossible"; return 0;} } } } if(ii%2 == 1) { if(il%2 != 1 ){ cout<<"Impossible"; return 0;} else { ye = pos(il,ii); ye = ye/2; if(ye%2 == 0) { if( (ji%2) != (jl%2) ){ cout<<"Impossible"; return 0;} } else { if( (ji%2) == (jl%2) ){ cout<<"Impossible"; return 0;} } } } int ir = pos(ii,il); int jr = pos(ji,jl); int count =0; if(ir%2 == 0) { ir = ir/2; jr = (jr-ir)/2; if(jr < 0 ) jr = 0; } else if(jr%2 == 0) { jr = jr/2; ir = (ir-jr)/2; if(ir < 0 ) ir = 0; } cout<<(ir+jr)<<"\n"; for(i=0;i<(ir+jr);i++) { if( pos(ji,jl) > pos(ii,il) ){ if( (jl - ji) > 1 ) { // cout<<"R "; arr[count] = 4; count++; ji = ji + 2; continue; } if( (ji - jl) > 1 ) { // cout<<"L "; arr[count] = 1; count++; ji = ji - 2; continue; } } if( pos(ji,jl) <= pos(ii,il) ){ if( ji > jl ) { if(ii < il) { // cout<<"LL "; arr[count] = 2; count++; ii = ii + 2; ji = ji - 1; } else { // cout<<"UL "; arr[count] = 6; count++; ii = ii - 2; ji = ji - 1; } } else { if(ii < il) { // cout<<"LR "; arr[count] = 3; count++; ii = ii + 2; ji = ji + 1; } else { // cout<<"UR "; arr[count] = 5; count++; ii = ii - 2; ji = ji + 1; } } } } std::sort(arr, arr+n, std::greater()); for(i=0;i