CSES - Aalto Competitive Programming 2024 - wk9 - Mon - Chess board tour
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Maija is playing with a weird chess board. She is trying to find a way to tour all the squares on the board by moving a pawn up, down, left or right. The pawn should visit each square exactly once. The board is n squares tall and m squares wide. The board's upper left corner has coordinates (1, 1) and the lower right corner is at (n, m). Find a sequence of moves that starts and ends in (1, 1) and visits all the squares or report that no such sequence exists.

Input

A single line contains two integer n and m.

Output

Print a string of length n \times m that describes the tour: the i-th letter is "L" if the i-th move is left. "R" corresponds to right, "U" to up and "D" to down. Otherwise, print "-1" if there are no suitable sequences.

Constraints

  • 2 \leq n, m \leq 1000

Example 1

Input:

4 2

Output:

DDDRUUUL

Example 2

Input:

3 3

Output:

-1