#include <iostream>
#include <vector>
#include <string>

using namespace std;

#define MAX_N 50
#define MAX_M 50
int n, m, T;
string F[MAX_N+1];
int GOAL_Y, GOAL_X;

struct Command {
    string name;
    int index; // for MOVETO
    string dir; // otherwise
};

vector<Command> cmds;

void find_player(int &y, int &x) {
    for (int i = 1; i <= n; i++) 
        for (int j = 0; j < m; j++) 
            if (F[i][j] == 'S') {
                y = i, x = j;
                return;
            }
    // player is not in the tower
    y = -1, x = -1;
}

void find_goal(int &y, int &x) {
    for (int i = 1; i <= n; i++) 
        for (int j = 0; j < m; j++) 
            if (F[i][j] == 'G') {
                y = i, x = j;
                return;
            }
    y = -1, x = -1;
}

bool valid_range(int y, int x) {
    return 0 <= y && y <= n && 0 <= x && x < m;
}

bool is_block(int y, int x) {
    if (!valid_range(y, x)) return false;
    return (F[y][x] != '.' && F[y][x] != 'S');
}

bool can_move_to(int y, int x) {
    if (!valid_range(y, x)) return false;
    return F[y][x] == '.';
}

void process_moveto(int index) {
    int y, x; find_player(y, x);
    if (!valid_range(y, x)) return;
    if (!can_move_to(y, index)) return;
    for (int i = min(x, index); i <= max(x, index); i++) 
        if (!is_block(y-1, i)) 
            return;
    F[y][index] = F[y][x];
    F[y][x] = '.';
}

void process_climb(string dir) {
    int y, x; find_player(y, x);
    if (!valid_range(y, x)) return;
    if (is_block(y+1, x)) return;
    if (dir == "RIGHT") {
        if (!can_move_to(y+1, x+1)) return;
        if (!is_block(y, x+1)) return;
        F[y][x] = '.';
        F[y+1][x+1] = 'S';
    } else {
        if (!can_move_to(y+1, x-1)) return;
        if (!is_block(y, x-1)) return;
        F[y][x] = '.';
        F[y+1][x-1] = 'S';
    }
}

void process_getdown(string dir) {
    int y, x; find_player(y, x);
    if (!valid_range(y, x)) return;
    if (dir == "RIGHT") {
        if (!can_move_to(y-1, x+1) || !can_move_to(y, x+1)) return;
        F[y][x] = '.';
        F[y-1][x+1] = 'S';
    } else {
        if (!can_move_to(y-1, x-1) || !can_move_to(y, x-1)) return;
        F[y][x] = '.';
        F[y-1][x-1] = 'S';
    }
}

void move_block(int y, int x, int d) {
    if (F[y][x] == 'I') {
        if (can_move_to(y, x+d)) {
            F[y][x+d] = F[y][x];
            F[y][x] = '.';
            if (valid_range(y-1, x+d) && F[y-1][x+d] != '.') {
                move_block(y, x+d, d);
            }
        } else {
            if (!valid_range(y, x+d)) F[y][x] = '.';
        }
    } else {
        if (can_move_to(y, x+d)) {
            F[y][x+d] = F[y][x];
            F[y][x] = '.';
            if (valid_range(y-1, x+d) && F[y-1][x+d] == 'I') {
                move_block(y, x+d, d);
            }
        } else {
            if (!valid_range(y, x+d)) F[y][x] = '.';
        }
    }
}

void process_push(string dir) {
    int y, x; find_player(y, x);
    if (!valid_range(y, x)) return;
    int dx = (dir == "RIGHT" ? 1 : -1);
    int to;
    for (to = x+dx; is_block(y, to); to += dx) 
        if (F[y][to] == 'C') return;
    for (int i = to; i != x; i -= dx) 
        move_block(y, i, dx);
}

void process_pull(string dir) {
    int y, x; find_player(y, x);
    if (!valid_range(y, x)) return;
    int dx = (dir == "RIGHT" ? 1 : -1);
    if (is_block(y, x-dx) && F[y][x-dx] != 'C' && can_move_to(y, x+dx)) {
        F[y][x+dx] = 'S';
        F[y][x] = F[y][x-dx];
        F[y][x-dx] = '.';
    }
}

void process(Command cmd) {
    if (cmd.name == "MOVETO") {
        process_moveto(cmd.index);
    } else if (cmd.name == "CLIMB") {
        process_climb(cmd.dir);
    } else if (cmd.name == "GETDOWN") {
        process_getdown(cmd.dir);
    } else if (cmd.name == "PUSH") {
        process_push(cmd.dir);
    } else if (cmd.name == "PULL") {
        process_pull(cmd.dir);
    }
}

bool over(string &res) {
    int y, x; find_player(y, x);
    if (is_block(y-1, x) && F[y-1][x] == 'G') {
        res = "Cleared";
        return true;
    }
    if (is_block(y-1, x) && F[y-1][x] == 'B') {
        res = "Death by Hole";
        return true;
    }
    if (!valid_range(y, x)) { // C
        res = "Death by Block";
        return true;
    }
    int gy, gx; find_goal(gy, gx);
    if (GOAL_Y != gy || GOAL_X != gx) {
        res = "Death by Walking Goal";
        return true;
    }
    return false;
}

void debug() {
    for (int i = n; i >= 0; i--) {
        cout << F[i] << endl;
    }
    cout << endl;
}

void post_process(int prev_y, int prev_x) {
    // fragile block
    if (is_block(prev_y-1, prev_x) && isdigit(F[prev_y-1][prev_x]) && F[prev_y][prev_x] != 'S') {
        F[prev_y-1][prev_x]--;
        if (F[prev_y-1][prev_x] == '0') 
            F[prev_y-1][prev_x] = '.';
    }
    bool updated = true;
    while (updated) {
        updated = false;
        for (int i = n; i > 0; i--) 
            for (int j = 0; j < m; j++) 
                if (is_block(i, j) && is_block(i-1, j) && F[i-1][j] == 'B') {
                    F[i][j] = '.';
                    updated = true;
                }
        int y, x; find_player(y, x);
        while (can_move_to(y-1, x)) {
            F[y][x] = '.';
            F[y-1][x] = 'S';
            y--;
            updated = true;
        }
        for (int i = 1; i <= n; i++) {
            for (int j = 0; j < m; j++) {
                if (is_block(i, j) && !is_block(i-1, j-1) && !is_block(i-1, j) && !is_block(i-1, j+1)) {
                    F[i-1][j] = F[i][j];
                    F[i][j] = '.'; 
                    updated = true;
                }
            }
        }
    }
}

int main() {
    while (cin >> n >> m, n || m) {
        cin.ignore();
        F[0] = string(m, '#');
        for (int i = n; i > 0; i--) getline(cin, F[i]);
        cin >> T; cin.ignore();
        cmds.clear(); cmds.resize(T);

        for (int i = 0; i < T; i++) {
            Command cmd;
            cin >> cmd.name;
            if (cmd.name == "MOVETO") {
                cin >> cmd.index;
                cmd.index--;
            } else {
                cin >> cmd.dir;
            }
            cmds[i] = cmd;
        }

        find_goal(GOAL_Y, GOAL_X);

        string res = "";
        for (int i = 0; i < T; i++) {
            if (over(res)) break;
            int prev_y, prev_x; find_player(prev_y, prev_x);
            process(cmds[i]);
            //cout << cmds[i].name << endl;
            //debug();
            if (over(res)) break;
            post_process(prev_y, prev_x);
            //cout << "post process" << endl;
            //debug();
            if (over(res)) break;
        }
        if (res == "") res = "Gave Up";
        cout << "Game Over : " << res << endl;
    }
    return 0;
}

Measured memory_bytes: 1320