/* Author : Abhinav Modified : 14-12-2017 10:07:16 PM */ #include using namespace std; typedef long long ll; typedef vector vi; const ll mod = 1e9+7; #define for(i,j,k) for(ll i=j; i v; while(1){ if(i_start == i_end && j_start == j_end){ flag = -1; break; } if(i_start-2 >= i_end && j_start-1 >= j_end-1){ v.emplace_back("UL"); i_start -= 2; j_start -= 1; } else if(i_start-2 >= i_end && j_start+1 <= j_end+1){ v.emplace_back("UR"); i_start -= 2; j_start += 1; } else if(j_start+2 <= j_end){ v.emplace_back("R"); j_start += 2; } else if(i_start+2 <= i_end && j_start+1 <= j_end+1){ v.emplace_back("LR"); i_start += 2; j_start += 1; } else if(i_start+2 <= i_end && j_start-1 >= j_end-1){ v.emplace_back("LL"); i_start += 2; j_start -= 1; } else if(j_start-2 >= j_end){ v.emplace_back("L"); j_start -= 2; } else if(i_start >= n || j_start >=n){ flag = 1; break; } else{ flag = 1; break; } } if(flag == 1) cout << "Impossible"; else{ cout << v.size() << "\n"; for(i,0,v.size()) cout << v[i] << " "; } } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }