#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; const int N = 205; const int inf = 1000 * 1000 * 1000; const int mod = 1000 * 1000 * 1000 + 7; int n; queue < pair > q; map < pair,int > mp; map < pair,pair > parent; int dx[10] = {-2 , -2 , 0 , 2 , 2 , 0}; int dy[10] = {-1 , 1 , 2 , 1 , -1 , -2}; map < pair,string > s; int main(){ s[{0 , -2}] = "L"; s[{0 , 2}] = "R"; s[{2 , -1}] = "LL"; s[{-2 , -1}] = "UL"; s[{2 , 1}] = "LR"; s[{-2 , 1}] = "UR"; cin>>n; int xs,ys,xe,ye; cin>>xs>>ys>>xe>>ye; mp[make_pair(xs , ys)] = 0; q.push(make_pair(xs , ys)); while(!q.empty()){ int x = q.front().first; int y = q.front().second; q.pop(); for(int i=0;i<6;i++){ int nx = x + dx[i]; int ny = y + dy[i]; if(nx < 0 || ny < 0 || nx >= n || ny >= n)continue; if(mp.find(make_pair(nx , ny)) != mp.end())continue; parent[make_pair(nx , ny)] = make_pair(x , y); mp[make_pair(nx , ny)] = mp[make_pair(x , y)] + 1; q.push(make_pair(nx , ny)); } } if(mp.find(make_pair(xe , ye)) == mp.end()){ cout<<"Impossible"< pat; while(xe != xs || ye != ys){ int px = parent[{xe , ye}].first; int py = parent[{xe , ye}].second; pat.push_back(s[{xe - px , ye - py}]); xe = px; ye = py; } reverse(pat.begin() , pat.end()); for(int i=0;i<(int)pat.size();i++) cout<