#include #include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n, x1, x2, y1, y2; cin >> n >> y1 >> x1 >> y2 >> x2; if ((y2 - y1) % 2) { cout << "Impossible\n"; } else { string ans = ""; int cnt = 0; if (x1 == x2) { if (y1 > y2) { while (y1 >= y2) { ans += "UL "; y1 -= 2; x1--; cnt++; if (y1 > y2) { ans += "UR "; y1 -= 2; x1++; cnt++; } } if (x1 != x2) { cout << "Impossible\n"; } else { cout << cnt << "\n" << ans << endl; } } else { while (y1 < y2) { ans += "LR "; y1 += 2; x1++; cnt++; if (y1 < y2) { ans += "LL "; y1 += 2; x1--; cnt++; } } if (x1 != x2) { cout << "Impossible\n"; } else { cout << cnt << "\n" << ans << endl; } } } else if (y1 >= y2 && x1 >= x2) { while (y1 > y2) { ans += "UL "; y1 -= 2; x1--; cnt++; } while (x1 > x2) { ans += "L "; x1 -= 2; cnt++; } if (x1 < x2) { cout << "Impossible\n"; } else { cout << cnt << "\n" << ans << endl; } } else if (y1 >= y2 && x1 < x2) { while (y1 > y2) { ans += "UR "; y1 -= 2; x1--; cnt++; } while (x1 < x2) { ans += "R "; x1 += 2; cnt++; } if (x1 > x2) { cout << "Impossible\n"; } else { cout << cnt << "\n" << ans << endl; } } else if (y1 < y2 && x1 >= x2) { while (y1 < y2) { ans += "LL "; y1 += 2; x1++; cnt++; } while (x1 > x2) { ans += "L "; x1 -= 2; cnt++; } if (x1 < x2) { cout << "Impossible\n"; } else { cout << cnt << "\n" << ans << endl; } } else { while (y1 < y2) { ans += "UR "; y1 += 2; x1++; cnt++; } while (x1 < x2) { ans += "R "; x1 += 2; cnt++; } if (x1 > x2) { cout << "Impossible\n"; } else { cout << cnt << "\n" << ans << endl; } } } return 0; }