Simulate the snake game that came with old Nokia phones.
The board is a 15×15 grid. Every cell holds a space, the letter X, or the letter F. X is the snake's body. When a game starts the snake is exactly three X cells side by side in one row. The rightmost of the three is the head, and the snake moves to the right. F is a food pellet. The snake eats pellets and grows without leaving the board and without running into itself.
One data set is a string of 20 characters made only of U, D, L, R and O. U turns the snake up, D down, L left, R right, and O keeps the current direction. Each character is one move.
A move is resolved in this order.
Once a game ends, the remaining characters of that data set are not processed.
Every data set starts again from the board given in the input.
The first 15 lines are the 15×15 grid. Each line has 15 characters, and trailing spaces may be missing. Exactly three cells hold X, and they are side by side in one row.
The next line has the number of data sets T. T is at least 1.
Each of the next T lines has a string of 20 characters made only of U, D, L, R and O.
For each data set print one line. Print GAME OVER if the game ended, otherwise print the number of pellets eaten, one space, and pellets. Write pellets even when the number is 1.
Then print the final board on 15 lines. A cell the snake occupies is X, a remaining pellet is F, and every other cell is a space. If the game ended because the snake left the board, the head is off the board and is not drawn.
Print a blank line between data sets.