시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 26 6 5 33.333%

문제

로봇과 다섯 개의 큐브가 단위 정사각형으로 나누어진 큰 보드 위에 있다. 로봇과 큐브는 각각 한 정사각형을 모두 차지하는 크기이다.

로봇은 위, 아래, 왼쪽, 오른쪽으로 한 칸 이동할 수 있다. 만약, 로봇이 이동하려는 칸에 큐브가 있다면, 로봇은 큐브를 움직이는 방향으로 한 칸 밀게 된다.

큐브는 흥미로운 자성을 가지고 있다. 두 큐브가 서로 인접한 칸에 있을 때(변을 공유하는 정사각형), 큐브는 붙게되고 한 물체가 된다. 한 물체가 된 큐브는 같이 움직이게 된다. 즉, 로봇이 붙어있는 큐브 중 하나를 밀면, 붙어있는 나머지 큐브도 같은 방향으로 움직인다.

로봇은 다섯 개의 큐브를 모두 붙어있게 하나로 만드려고 한다. 이때, 위에서 봤을 때, 큐브가 이루는 모습은 T자 모양이어야 한다. (T자가 회전되면 안된다)

큐브의 위치가 주어졌을 때, T자 모양으로 만드는 프로그램을 작성하시오.

입력

입력은 총 다섯 줄이다. 각 줄에는 큐브의 위치 X와 Y가 주어진다. (-5 ≤ X, Y ≤ 5)

로봇은 가장 처음에 (0, 0)에 있고, 여기에는 큐브가 없다.

입력으로 주어지는 큐브가 처음부터 인접하는 상태는 없다. 즉, 변을 공유하는 큐브는 없다. 하지만 꼭짓점을 공유할 수는 있다.

출력

로봇이 어떻게 움직여야 하는지 한 줄에 모두 출력한다. 위로 움직이는 것은 U, 왼쪽은 L, 오른쪽은 R, 아래는 D로 출력한다.

로봇이 움직이는 횟수는 9999를 넘을 수 없다.

예제 입력 1

0 1
-1 0
1 0
0 -1
0 -3

예제 출력 1

DRRUUULLDD
W3sicHJvYmxlbV9pZCI6IjI5OTYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQwNTBcdWJlMGMgXHViYWE4XHVjNzNjXHVhZTMwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWI4NWNcdW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