#include #include #include #include #include #include #include #include #include using namespace std; typedef pair ii; void bfs(pair,pair); vector adj_list[205][205]; bool visited[205][205]={false}; map > dist; int main() { int n; cin>>n; pair source,end; cin>>source.first>>source.second>>end.first>>end.second; for(int i=0;i=1) { if(j!=1) adj_list[i][j].push_back(make_pair(i,j-2)); adj_list[i][j].push_back(make_pair(i+2,j-1)); if(j=2&&j<1) { adj_list[i][j].push_back(make_pair(i-2,j+1)); adj_list[i][j].push_back(make_pair(i,j+2)); if(i=2&&j>=1) { if(j!=1) adj_list[i][j].push_back(make_pair(i,j-2)); adj_list[i][j].push_back(make_pair(i-2,j-1)); if(j q; q.push(make_pair(source.first,source.second)); while(!q.empty()) { ii temp=q.front(); q.pop(); for(auto it=adj_list[temp.first][temp.second].begin();it!=adj_list[temp.first][temp.second].end();it++) { if(!visited[it->first][it->second]) { visited[it->first][it->second]=true; q.push(make_pair(it->first,it->second)); if(it->first==temp.first&&it->second==temp.second-2) dist[make_pair(it->first,it->second)]=make_pair(1+dist[make_pair(temp.first,temp.second)].first,"R"); else if(it->first==temp.first&&it->second==temp.second+2) dist[make_pair(it->first,it->second)]=make_pair(1+dist[make_pair(temp.first,temp.second)].first,"L"); else if(it->first==temp.first-2&&it->second==temp.second-1) dist[make_pair(it->first,it->second)]=make_pair(1+dist[make_pair(temp.first,temp.second)].first,"LR"); else if(it->first==temp.first-2&&it->second==temp.second+1) dist[make_pair(it->first,it->second)]=make_pair(1+dist[make_pair(temp.first,temp.second)].first,"LL"); else if(it->first==temp.first+2&&it->second==temp.second-1) dist[make_pair(it->first,it->second)]=make_pair(1+dist[make_pair(temp.first,temp.second)].first,"UR"); else if(it->first==temp.first+2&&it->second==temp.second+1) dist[make_pair(it->first,it->second)]=make_pair(1+dist[make_pair(temp.first,temp.second)].first,"UL"); } } } stack s,result; if(visited[end.first][end.second]==false) cout<<"Impossible\n"; else { cout<