// // Author: Harsh_Vasoya, DA-IICT // #include #define sync_off std::ios_base::sync_with_stdio(false); cin.tie(NULL); #define lli long long int #define hashmap unordered_map #define hashset unordered_set #define all(v) v.begin(),v.end() #define pb push_back #define pii pair #define mp make_pair #define F first #define S second #define si(n) scanf("%d",&n) #define sii(n,m) scanf("%d%d",&n,&m) #define slli(n) scanf("%lld",&n) #define forn(i,a,b) for(int i=a;i start,end; sii(start.F,start.S); sii(end.F,end.S); if(abs(end.F-start.F)%2!=0){ printf("Impossible\n"); return 0; } pair curr = start; vector path; while(curr != end){ if(curr.F > end.F){ if(curr.S >= end.S){ // UL curr.F -= 2; curr.S -= 1; path.pb(1); } else{ curr.F -= 2; // UR curr.S += 1; path.pb(2); } } else if(curr.F == end.F){ if(abs(curr.S-end.S)%2!=0){ printf("Impossible\n"); return 0; } if(curr.S > end.S){ // L curr.S -= 2; path.pb(6); } else{ // R curr.S += 2; path.pb(3); } } else{ if(curr.S <= end.S){ // LR curr.F += 2; curr.S += 1; path.pb(4); } else{ curr.F += 2; // LL curr.S -= 1; path.pb(5); } } } sort(all(path)); printf("%d\n", path.size()); forn(i,0,path.size()){ switch(path[i]){ case 1: printf("UL "); break; case 2: printf("UR "); break; case 3: printf("R "); break; case 4: printf("LR "); break; case 5: printf("LL "); break; case 6: printf("L "); break; } } return 0; }