Lovely penguins is a tiny game in which the player controls two penguins.
The game holds in two

grids (the left one and the right one), a
nd each has some blocked places.
We number the grid in

row (starting from the up),

column (starting from the left)
%7D)
.
The penguins move in four directions: up, down, left, right, exactly one step once. If its way is blocked, or it reaches the border, then this movement is omitted.
The player also moves the penguins in four directions, but the behavior of the two penguins is mirrored:
- L : left penguin moves to left, right penguin moves to right.
- R : left penguin moves to right, right penguin moves to left.
- U : both move upwards.
- D : both move downwards.
An operation can be omitted on one penguin but works on another.
The left penguin starts from
and wants to move to
.The right penguin starts from
%7D)
and wants to move to
%7D)
.If both
penguin reach there destination, thay win the game.
Find out the shortest way to win the game.If there are many shortest ways to win, find the one with minimum lexicographical order(D<L<R<U).
Note: When one penguin reaches the destination and the other does not, the penguin that has reached the destination may still move out of the destination.
输入描述:
The input consists of 20 lines, each line contains 41 characters, describing the grids, separated by a space.
'.' means the grid is empty.
'#' means the grid is blocked.
输出描述:
Output 22 lines.
The first line contains the least number of steps to win the game.
The second line contains a string consisting of 'L','R','U','D', describing a way to win.
There may be many ways to win, output the one with minimum lexicographical order.
Then output 20 lines, describing the track of the two penguins, mark the track with character 'A', and print as input.
示例1
输入
复制
#................... .............##...#.
.................... .......#.....#.....#
.........#...#.#.... ...#....#...........
#........#.......... ...#..#.............
........#......#.... ..#.#......#.#.....#
......#.#..#.#....#. .......##.....##...#
....#...........#..# ....................
.##................. ...........#..#...#.
.....#.#........#.#. #.........#.#.......
.................... ..#....#..........#.
....#.#..........#.. .#.........#..#..#..
.........#.......#.. ..#.................
...#..#......#...#.. ......#.............
...........#...#.... ....................
..##..#.#....#..#... ..............#...#.
.#..#...#.#.....##.. .........#.#...#....
.#.........#........ ..............#.#...
..##.#........#...#. ##..................
....##.#............ .......#.....#......
..........##........ .#..#.#...........#.
输出
复制
27
LULLUURRUUUUUUULUUUUURRUUUU
#..................A A............##...#.
...................A A......#.....#.....#
.........#...#.#...A A..#....#...........
#........#.........A A..#..#.............
........#......#.AAA AA#.#......#.#.....#
......#.#..#.#...A#. .A.....##.....##...#
....#...........#A.# .A..................
.##..............A.. .A.........#..#...#.
.....#.#........#A#. #A........#.#.......
.................AA. AA#....#..........#.
....#.#..........#A. A#.........#..#..#..
.........#.......#A. A.#.................
...#..#......#...#A. A.....#.............
...........#...#..A. A...................
..##..#.#....#..#.A. A.............#...#.
.#..#...#.#.....##A. A........#.#...#....
.#.........#....AAA. AAA...........#.#...
..##.#........#.A.#. ##A.................
....##.#........AAA. AAA....#.....#......
..........##......AA A#..#.#...........#.
备注:
It's guaranteed that there always exists a way to win, and the penguins' initial position is not blocked.