#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using namespace std;

namespace {

const string ALPHABET =
    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/";

int value_of(char ch) {
    size_t pos = ALPHABET.find(ch);
    return pos == string::npos ? 0 : static_cast<int>(pos);
}

int assigned_count(int total, int agents, int id) {
    if (id >= total) return 0;
    return (total - 1 - id) / agents + 1;
}

string encode_bits(const vector<unsigned char> &bits, int start, int max_chars) {
    int remaining = static_cast<int>(bits.size()) - start;
    int chars = min(max_chars, (remaining + 5) / 6);
    string encoded;
    encoded.reserve(chars);

    for (int i = 0; i < chars; ++i) {
        int val = 0;
        for (int b = 0; b < 6; ++b) {
            int pos = start + i * 6 + b;
            if (pos < static_cast<int>(bits.size()) && bits[pos]) {
                val |= 1 << b;
            }
        }
        encoded.push_back(ALPHABET[val]);
    }

    return encoded;
}

void send_line(const string &s) {
    cout << s << '\n';
    cout.flush();
}

string read_line() {
    string s;
    if (!getline(cin, s)) exit(0);
    return s;
}

void send_message_to_zero(const string &body) {
    send_line("> 0 " + body);
    read_line();
}

string build_path(int n, const vector<unsigned char> &open) {
    int total = n * n;
    vector<int> parent(total, -1);
    vector<char> step(total, 0);
    queue<int> q;

    parent[0] = 0;
    q.push(0);

    const int dr[4] = {-1, 1, 0, 0};
    const int dc[4] = {0, 0, -1, 1};
    const char dir[4] = {'U', 'D', 'L', 'R'};

    while (!q.empty() && parent[total - 1] == -1) {
        int v = q.front();
        q.pop();
        int r = v / n;
        int c = v % n;

        for (int k = 0; k < 4; ++k) {
            int nr = r + dr[k];
            int nc = c + dc[k];
            if (nr < 0 || nr >= n || nc < 0 || nc >= n) continue;

            int to = nr * n + nc;
            if (!open[to] || parent[to] != -1) continue;

            parent[to] = v;
            step[to] = dir[k];
            q.push(to);
        }
    }

    string path;
    for (int v = total - 1; v != 0; v = parent[v]) {
        if (v < 0 || parent[v] == -1) return "";
        path.push_back(step[v]);
    }
    reverse(path.begin(), path.end());
    return path;
}

}  // namespace

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int N, NUM_AGENTS, AGENT_ID, MAX_MSG_LEN;
    if (!(cin >> N >> NUM_AGENTS >> AGENT_ID >> MAX_MSG_LEN)) return 0;
    string startup_rest;
    getline(cin, startup_rest);

    if (N == 1) {
        if (AGENT_ID == 0) {
            send_line("!");
        } else {
            send_line("halt");
        }
        return 0;
    }

    const int total = N * N;
    const int my_count = assigned_count(total, NUM_AGENTS, AGENT_ID);
    const int query_turns = (total + NUM_AGENTS - 1) / NUM_AGENTS;

    vector<unsigned char> local_bits;
    local_bits.reserve(my_count);

    for (int t = 0; t < query_turns; ++t) {
        int idx = AGENT_ID + t * NUM_AGENTS;
        if (idx < total) {
            int r = idx / N + 1;
            int c = idx % N + 1;
            send_line("? " + to_string(r) + " " + to_string(c));
            string reply = read_line();
            local_bits.push_back(!reply.empty() && reply[0] == '1');
        } else {
            send_line(".");
            read_line();
        }
    }

    if (AGENT_ID != 0) {
        int pos = 0;
        while (pos < my_count) {
            string header = to_string(pos) + ":";
            int room = MAX_MSG_LEN - static_cast<int>(header.size());
            if (room <= 0) {
                send_message_to_zero("E");
                send_line("halt");
                return 0;
            }

            string payload = encode_bits(local_bits, pos, room);
            send_message_to_zero(header + payload);
            pos += static_cast<int>(payload.size()) * 6;
        }

        send_message_to_zero("E");
        send_line("halt");
        return 0;
    }

    vector<unsigned char> open(total, 0);
    for (int i = 0; i < my_count; ++i) {
        int idx = i * NUM_AGENTS;
        open[idx] = local_bits[i];
    }

    vector<unsigned char> finished(NUM_AGENTS, 0);
    finished[0] = 1;
    int done = 1;

    while (done < NUM_AGENTS) {
        send_line("< ?");
        string reply = read_line();
        if (reply == "- -") continue;

        size_t space = reply.find(' ');
        if (space == string::npos) continue;

        int sender = stoi(reply.substr(0, space));
        string body = reply.substr(space + 1);

        if (body == "E") {
            if (!finished[sender]) {
                finished[sender] = 1;
                ++done;
            }
            continue;
        }

        size_t colon = body.find(':');
        if (colon == string::npos) continue;

        int start = stoi(body.substr(0, colon));
        string payload = body.substr(colon + 1);
        int sender_count = assigned_count(total, NUM_AGENTS, sender);

        for (int i = 0; i < static_cast<int>(payload.size()); ++i) {
            int val = value_of(payload[i]);
            for (int b = 0; b < 6; ++b) {
                int local_pos = start + i * 6 + b;
                if (local_pos >= sender_count) break;

                int idx = sender + local_pos * NUM_AGENTS;
                if (idx < total) {
                    open[idx] = (val >> b) & 1;
                }
            }
        }
    }

    string path = build_path(N, open);
    send_line("! " + path);
    return 0;
}
