Codeforces Round 869 (Div. 1) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

constructive algorithms

games

implementation

*2700

No tag edit access

The problem statement has recently been changed. View the changes.

×
D. Toy Machine

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputThere is a toy machine with toys arranged in two rows of $$$n$$$ cells each ($$$n$$$ is odd).

Initially, $$$n-2$$$ toys are placed in the non-corner cells of the top row. The bottom row is initially empty, and its leftmost, rightmost, and central cells are blocked. There are $$$4$$$ buttons to control the toy machine: left, right, up, and down marked by the letters L, R, U, and D correspondingly.

When pressing L, R, U, or D, all the toys will be moved simultaneously in the corresponding direction and will only stop if they push into another toy, the wall or a blocked cell. Your goal is to move the $$$k$$$-th toy into the leftmost cell of the top row. The toys are numbered from $$$1$$$ to $$$n-2$$$ from left to right. Given $$$n$$$ and $$$k$$$, find a solution that uses at most $$$1\,000\,000$$$ button presses.

To test out the toy machine, a web page is available that lets you play the game in real time.

Input

The first and only line contains two integers, $$$n$$$ and $$$k$$$ ($$$5 \le n \le 100\,000$$$, $$$n$$$ is odd, $$$1 \le k \le n-2$$$) — the number of cells in a row, and the index of the toy that has to be moved to the leftmost cell of the top row.

Output

On a single line, output a description of the button presses as a string of at most $$$1\,000\,000$$$ characters. The string should only contain the characters L, R, U, and D. The $$$i$$$-th character in the string is the $$$i$$$-th button that is pressed. After all the button presses are performed, the $$$k$$$-th toy should be in the leftmost cell of the top row.

If there are multiple solutions, print any. The number of button presses does not have to be minimized.

Examples

Input

5 1

Output

RDL

Input

7 2

Output

RDL

Note

In the first example, there will be $$$5-2 = 3$$$ toys. The first toy needs to end up in the leftmost cell of the top row. The moves RDL will achieve this, see the picture for a better understanding. Another possible solution would be to do one button press L.

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: May/29/2024 18:25:28 (j3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|