#include using namespace std; #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define endl "\n" #define int long long #define ff first #define ss second #define trace1(x) cerr<<#x<<": "< output; int dp(int x, int y) { if(x<0||y<0||x>n||y>n) return 0; if(x==c&&y==d) return 1; if(cache[x][y]!=-1) { return cache[x][y]; } int &ans=cache[x][y]; ans=0; ans|=dp(x-2, y-1); ans|=dp(x-2, y+1); ans|=dp(x, y+2); ans|=dp(x+2, y+1); ans|=dp(x+2, y-1); ans|=dp(x, y-2); return ans; } int dp2(int x, int y) { if(x<0||y<0||x>n||y>n) return 1e9; if(x==c&&y==d) return 0; if(cache2[x][y]!=-1) { return cache2[x][y]; } int &ans=cache2[x][y]; ans=1e9; ans=min(ans, 1+dp2(x-2, y-1)); ans=min(ans, 1+dp2(x-2, y+1)); ans=min(ans, 1+dp2(x, y+2)); ans=min(ans, 1+dp2(x+2, y+1)); ans=min(ans, 1+dp2(x+2, y-1)); ans=min(ans, 1+dp2(x, y-2)); return ans; } void path(int x, int y) { if(x<0||y<0||x>n||y>n) return; if(x==c&&y==d) return; int ans=cache2[x][y]; if(1+dp2(x-2, y-1)==ans) { output.push_back("UL"); path(x-2, y-1); return; } if(1+dp2(x-2, y+1)==ans) { output.push_back("UR"); path(x-2, y+1); return; } if(1+dp2(x, y+2)==ans) { output.push_back("R"); path(x, y+2); return; } if(1+dp2(x+2, y+1)==ans) { output.push_back("LR"); path(x+2, y+1); return; } if(1+dp2(x+2, y-1)==ans) { output.push_back("LL"); path(x+2, y-1); return; } if(1+dp2(x, y-2)==ans) { output.push_back("L"); path(x, y-2); return; } } int32_t main() { IOS; memset(cache, -1, sizeof(cache)); memset(cache2, -1, sizeof(cache2)); cin>>n>>a>>b>>c>>d; if(!dp(a,b)) { cout<<"Impossible"; return 0; } dp2(a, b); path(a, b); cout<