// Arup Guha
// 10/6/2013
// Solution to 2011 MCPC Problem G: Sokoban

import java.util.*;

public class g {

	public static int[] curPos;
	public static char[][] grid;
	public static int R;
	public static int C;
	public static boolean done;
	public static boolean onCorrect;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		R = stdin.nextInt();
		C = stdin.nextInt();
		int loop = 1;

		// Go through each case.
		while (R != 0) {

			// Read in grid.
			grid = new char[R][];
			for (int i=0; i<R; i++)
				grid[i] = stdin.next().toCharArray();
			String script = stdin.next();
			done = false;
			onCorrect = false;
			curPos = getCurPos();

			// Go through each move.
			for (int i=0; i<script.length(); i++) {
				update(script.charAt(i));

				// Get out if we're done/
				if (complete()) {
					done = true;
					break;
				}
			}

			// Case header.
			if (done)
				System.out.println("Game "+loop+": complete");
			else
				System.out.println("Game "+loop+": incomplete");

			// This is the grid.
			for (int i=0; i<R; i++)
				System.out.println(new String(grid[i]));

			// Get next case.
			R = stdin.nextInt();
			C = stdin.nextInt();
			loop++;
		}

	}

	// Find the current position (x,y) and return it.
	public static int[] getCurPos() {

		for (int i=0; i<grid.length; i++) {
			for (int j=0; j<grid[i].length; j++) {

				// Found it. Also mark if it's a correct box spot or not.
				if (grid[i][j] == 'w' || grid[i][j] == 'W') {
					int[] ans = new int[2];
					ans[0] = i; ans[1] = j;
					if (grid[i][j] == 'W') onCorrect = true;
					return ans;
				}
			}
		}

		// Should never happen.
		return null;
	}

	// Returns true iff game is done.
	public static boolean complete() {

		// Can't win if we're on a winning square...
		if (onCorrect) return false;

		// Look for + to indicate unfinished game.
		for (int i=0; i<grid.length; i++)
			for (int j=0; j<grid[i].length; j++)
				if (grid[i][j] == '+')
					return false;

		// Game is done.
		return true;
	}

	public static void update(char dir) {

		// Update in the designated direction.
		if (dir == 'U')
			update(-1,0);
		else if (dir == 'D')
			update(1,0);
		else if (dir == 'L')
			update(0,-1);
		else
			update(0,1);
	}

	// Update from the current position moving in the direction (dx,dy).
	public static void update(int dx, int dy) {

		// Get our current position.
		int x = curPos[0];
		int y = curPos[1];

		// Move into empty square.
		if (grid[x+dx][y+dy] == '.') {
			grid[x+dx][y+dy] = 'w';
			if (onCorrect)
				grid[x][y] = '+';
			else
				grid[x][y] = '.';
			curPos[0] += dx;
			curPos[1] += dy;
			onCorrect = false;
		}

		// Move to worker to correct position.
		else if (grid[x+dx][y+dy] == '+') {
			grid[x+dx][y+dy] = 'W';
			if (onCorrect)
				grid[x][y] = '+';
			else
				grid[x][y] = '.';
			curPos[0] += dx;
			curPos[1] += dy;
			onCorrect = true;
		}

		// Box in front of me.
		else if (grid[x+dx][y+dy] == 'b' || grid[x+dx][y+dy] == 'B') {

			// Move box into regular empty square.
			if (inbounds(x+2*dx, y+2*dy) && grid[x+2*dx][y+2*dy] == '.') {

				// This square will empty out.
				if (onCorrect)
					grid[x][y] = '+';
				else
					grid[x][y] = '.';

				// This is tricky, we have to check what this square used to be.
				if (grid[x+dx][y+dy] == 'b') {
					grid[x+dx][y+dy] = 'w';
					onCorrect = false;
				}
				else {
					grid[x+dx][y+dy] = 'W';
					onCorrect = true;
				}

				// We know this will be the case.
				grid[x+2*dx][y+2*dy] = 'b';
				curPos[0] += dx;
				curPos[1] += dy;
			}

			// Move box into correct square.
			else if (inbounds(x+2*dx, y+2*dy) && grid[x+2*dx][y+2*dy] == '+') {

				// This square will empty out.
				if (onCorrect)
					grid[x][y] = '+';
				else
					grid[x][y] = '.';

				// Same possibility as before.
				if (grid[x+dx][y+dy] == 'b') {
					grid[x+dx][y+dy] = 'w';
					onCorrect = false;
				}
				else {
					grid[x+dx][y+dy] = 'W';
					onCorrect = true;
				}

				// We know this will be the case.
				grid[x+2*dx][y+2*dy] = 'B';
				curPos[0] += dx;
				curPos[1] += dy;
			}
		}
	}

	public static boolean inbounds(int x, int y) {
		return x >= 0 && y >= 0 && x < R && y < C;
	}
}