#atcoderABC051C. Back and Forth
Back and Forth
Problem
Dolphin resides in two-dimensional Cartesian plane, with the positive -axis pointing right and the positive -axis pointing up.
Currently, he is located at the point . In each second, he can move up, down, left or right by a distance of .
Here, both the - and -coordinates before and after each movement must be integers.
He will first visit the point where and , then go back to the point , then visit the point again, and lastly go back to the point .
Here, during the whole travel, he is not allowed to pass through the same point more than once, except the points and .
Under this condition, find a shortest path for him.
Constraints
- and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print a string that represents a shortest path for Dolphin.
The -th character in should correspond to his -th movement.
The directions of the movements should be indicated by the following characters:
U
: UpD
: DownL
: LeftR
: Right
If there exist multiple shortest paths under the condition, print any of them.
Example : 1. in
0 0 1 2
Example : 1. out
UURDDLLUUURRDRDDDLLU
One possible shortest path is:
- Going from to for the first time: → → →
- Going from to for the first time: → → →
- Going from to for the second time: → → → → → → →
- Going from to for the second time: → → → → → → →
Example : 2. in
-2 -2 1 1
Example : 2. out
UURRURRDDDLLDLLULUUURRURRDDDLLDL
相关
在下列比赛中: