Codeforces Beta Round 71
E
Security System
Codeforces
2900
原题
← D→
翻译中…

Fox Ciel safely returned to her castle, but there was something wrong with the security system of the castle: sensors attached in the castle were covering her.

翻译中…

Ciel is at point $(1, 1)$ of the castle now, and wants to move to point $(*n*, *n*)$, which is the position of her room. By one step, Ciel can move from point $(*x*, *y*)$ to either $(*x* + 1, *y*)$ (rightward) or $(*x*, *y* + 1)$ (upward).

翻译中…

In her castle, $*c*^{2}$ sensors are set at points $(*a* + *i*, *b* + *j*)$ (for every integer $*i*$ and $*j*$ such that: $0 ≤ *i* < *c*, 0 ≤ *j* < *c*$).

翻译中…

Each sensor has a count value and decreases its count value every time Ciel moves. Initially, the count value of each sensor is $*t*$. Every time Ciel moves to point $(*x*, *y*)$, the count value of a sensor at point $(*u*, *v*)$ decreases by ($|*u* - *x*| + |*v* - *y*|$). When the count value of some sensor becomes strictly less than $0$, the sensor will catch Ciel as a suspicious individual!

翻译中…

Determine whether Ciel can move from $(1, 1)$ to $(*n*, *n*)$ without being caught by a sensor, and if it is possible, output her steps. Assume that Ciel can move to every point even if there is a censor on the point.

翻译中…

Input

翻译中…

In the first line there are five integers $*n*, *t*, *a*, *b*, *c*$ ($2 ≤ *n* ≤ 2·10^{5},$ $0 ≤ *t* ≤ 10^{14},$ $1 ≤ *a* ≤ *n* - *c* + 1,$ $1 ≤ *b* ≤ *n* - *c* + 1,$ $1 ≤ *c* ≤ *n*$).

翻译中…

Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin stream (also you may use the %I64d specificator).

翻译中…

Output

翻译中…

If Ciel's objective is possible, output in first line $2*n* - 2$ characters that represent her feasible steps, where $*i*$-th character is R if $*i*$-th step is moving rightward, or U if moving upward. If there are several solution, output lexicographically first one. Character R is lexicographically earlier than the character U.

翻译中…

If her objective is impossible, output Impossible.

翻译中…

Note

翻译中…

The answers for the first sample and the second sample are shown on the picture:

翻译中…

image

翻译中…

Here, a red point represents a point that contains a sensor.

翻译中…

样例

Input #1
5 25 2 4 1
Output #1
RRUURURU
InputCopy OutputCopy
Input #2
3 6 1 2 2
Output #2
URUR
InputCopy OutputCopy
Input #3
3 5 1 2 2
Output #3
Impossible
InputCopy OutputCopy
Input #4
20 492 11 4 8
Output #4
RRRRRRRRRRRRRRRRUUUUURUUUUURRUUUUUUUUU
InputCopy OutputCopy
题目信息
题号
79E
时间限制
1 s
内存限制
256 MB
标签
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。