#include <bits/stdc++.h>
using namespace std;

int N, NUM_AGENTS, AGENT_ID, MAX_MSG_LEN;
const string ALPH = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int REV[128];

static void say_claim(const string &path) {
    cout << "! " << path << '\n' << flush;
}

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

static int chunk_count(int bit_count, int data_chars) {
    if (bit_count <= 0) return 0;
    return (bit_count + 6 * data_chars - 1) / (6 * data_chars);
}

static vector<int> make_cells(int phase) {
    // phase 0: all cells
    // phase 1: all cells except even-even cells
    // phase 2: even-even cells
    vector<int> cells;
    if (phase == 0) cells.reserve(N * N);
    for (int r = 1; r <= N; ++r) {
        for (int c = 1; c <= N; ++c) {
            bool even_even = (r % 2 == 0 && c % 2 == 0);
            if (phase == 0 || (phase == 1 && !even_even) || (phase == 2 && even_even)) {
                cells.push_back((r - 1) * N + (c - 1));
            }
        }
    }
    return cells;
}

static vector<unsigned char> query_assigned(const vector<int> &cells) {
    vector<unsigned char> bits;
    bits.reserve(assigned_count((int)cells.size(), AGENT_ID));
    for (int pos = AGENT_ID; pos < (int)cells.size(); pos += NUM_AGENTS) {
        int idx = cells[pos];
        int r = idx / N + 1;
        int c = idx % N + 1;
        cout << "? " << r << ' ' << c << '\n' << flush;
        int ans;
        if (!(cin >> ans)) exit(0);
        bits.push_back((unsigned char)(ans == 1));
    }
    return bits;
}

static string encode_chunk(const vector<unsigned char> &bits, int start, int data_chars, char phase) {
    string body;
    if (phase != 0) body.push_back(phase);
    int end = min((int)bits.size(), start + 6 * data_chars);
    for (int i = start; i < end; i += 6) {
        int v = 0;
        for (int b = 0; b < 6 && i + b < end; ++b) {
            if (bits[i + b]) v |= (1 << b);
        }
        body.push_back(ALPH[v]);
    }
    return body;
}

static void send_bits_to_leader(const vector<unsigned char> &bits, char phase, int data_chars) {
    int step = 6 * data_chars;
    for (int pos = 0; pos < (int)bits.size(); pos += step) {
        string body = encode_chunk(bits, pos, data_chars, phase);
        cout << "> 0 " << body << '\n' << flush;
        string ok;
        if (!(cin >> ok)) exit(0);
    }
}

static void decode_append(const string &enc, vector<unsigned char> &dst, int expected) {
    for (char ch : enc) {
        int uc = (unsigned char)ch;
        int v = (uc < 128 ? REV[uc] : 0);
        for (int b = 0; b < 6 && (int)dst.size() < expected; ++b) {
            dst.push_back((unsigned char)((v >> b) & 1));
        }
    }
}

struct PhaseState {
    int data_chars = 0;
    vector<vector<unsigned char>> bits;
    vector<int> expected;
    vector<int> chunks_expected;
    vector<int> chunks_got;
    int remaining_chunks = 0; // only chunks from non-leader agents
};

static void init_phase(PhaseState &st, int cell_count, int data_chars) {
    st.data_chars = data_chars;
    st.bits.assign(NUM_AGENTS, {});
    st.expected.assign(NUM_AGENTS, 0);
    st.chunks_expected.assign(NUM_AGENTS, 0);
    st.chunks_got.assign(NUM_AGENTS, 0);
    st.remaining_chunks = 0;
    for (int s = 0; s < NUM_AGENTS; ++s) {
        st.expected[s] = assigned_count(cell_count, s);
        st.chunks_expected[s] = chunk_count(st.expected[s], data_chars);
        st.bits[s].reserve(st.expected[s]);
        if (s != 0) st.remaining_chunks += st.chunks_expected[s];
    }
}

static void receive_one(PhaseState &phase_a, PhaseState &phase_b) {
    cout << "< ?" << '\n' << flush;
    string sender_token, body;
    if (!(cin >> sender_token >> body)) exit(0);
    if (sender_token == "-") return;

    int sender = stoi(sender_token);
    if (body.empty()) return;
    int p = (body[0] == 'A') ? 0 : 1;
    string enc = body.substr(1);
    PhaseState &st = (p == 0 ? phase_a : phase_b);
    if (sender >= 0 && sender < NUM_AGENTS && st.chunks_got[sender] < st.chunks_expected[sender]) {
        decode_append(enc, st.bits[sender], st.expected[sender]);
        st.chunks_got[sender]++;
        if (sender != 0) st.remaining_chunks--;
    }
}

static void apply_phase(const vector<int> &cells, const PhaseState &st, vector<unsigned char> &open) {
    for (int s = 0; s < NUM_AGENTS; ++s) {
        int cnt = st.expected[s];
        for (int j = 0; j < cnt; ++j) {
            int pos = s + j * NUM_AGENTS;
            if (pos < (int)cells.size() && j < (int)st.bits[s].size()) {
                open[cells[pos]] = st.bits[s][j];
            }
        }
    }
}

static bool find_path(const vector<unsigned char> &open, string &path) {
    int total = N * N;
    if (total == 0 || !open[0] || !open[total - 1]) return false;

    vector<int> parent(total, -2);
    vector<char> how(total, 0);
    deque<int> q;
    parent[0] = -1;
    q.push_back(0);

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

    while (!q.empty()) {
        int v = q.front();
        q.pop_front();
        if (v == total - 1) break;
        int r = v / N;
        int c = v % N;
        for (int d = 0; d < 4; ++d) {
            int nr = r + dr[d], nc = c + dc[d];
            if (nr < 0 || nr >= N || nc < 0 || nc >= N) continue;
            int to = nr * N + nc;
            if (!open[to] || parent[to] != -2) continue;
            parent[to] = v;
            how[to] = mv[d];
            q.push_back(to);
        }
    }

    if (parent[total - 1] == -2) return false;
    string rev;
    for (int v = total - 1; v != 0; v = parent[v]) rev.push_back(how[v]);
    reverse(rev.begin(), rev.end());
    path.swap(rev);
    return true;
}

static void leader_only_fallback() {
    if (AGENT_ID != 0) {
        cout << "halt" << '\n' << flush;
        return;
    }
    vector<unsigned char> open(N * N, 0);
    for (int idx = 0; idx < N * N; ++idx) {
        int r = idx / N + 1;
        int c = idx % N + 1;
        cout << "? " << r << ' ' << c << '\n' << flush;
        int ans;
        if (!(cin >> ans)) return;
        open[idx] = (unsigned char)(ans == 1);
    }
    string path;
    if (find_path(open, path)) say_claim(path);
}

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

    for (int i = 0; i < 128; ++i) REV[i] = 0;
    for (int i = 0; i < (int)ALPH.size(); ++i) REV[(int)ALPH[i]] = i;

    if (!(cin >> N >> NUM_AGENTS >> AGENT_ID >> MAX_MSG_LEN)) return 0;

    if (N == 1) {
        if (AGENT_ID == 0) say_claim("");
        else cout << "halt" << '\n' << flush;
        return 0;
    }

    // The main protocol uses a one-byte phase tag in each message.
    // The official value is 256; if it ever is too small, use a safe single-agent fallback.
    if (MAX_MSG_LEN < 2) {
        leader_only_fallback();
        return 0;
    }

    int data_chars = MAX_MSG_LEN - 1;
    vector<int> cells1 = make_cells(1); // likely useful cells: not even-even

    if (AGENT_ID != 0) {
        vector<unsigned char> b1 = query_assigned(cells1);
        send_bits_to_leader(b1, 'A', data_chars);

        // Pipeline the fallback phase. If agent 0 can already prove a path, the run ends
        // while we are here; otherwise these results are ready for it.
        vector<int> cells2 = make_cells(2); // even-even cells
        vector<unsigned char> b2 = query_assigned(cells2);
        send_bits_to_leader(b2, 'B', data_chars);

        cout << "halt" << '\n' << flush;
        return 0;
    }

    vector<int> cells2 = make_cells(2);
    PhaseState phase1, phase2;
    init_phase(phase1, (int)cells1.size(), data_chars);
    init_phase(phase2, (int)cells2.size(), data_chars);

    vector<unsigned char> open(N * N, 0);

    phase1.bits[0] = query_assigned(cells1);
    phase1.chunks_got[0] = phase1.chunks_expected[0];

    while (phase1.remaining_chunks > 0) receive_one(phase1, phase2);
    apply_phase(cells1, phase1, open);

    string path;
    if (find_path(open, path)) {
        say_claim(path);
        return 0;
    }

    // Rare fallback: the real path used at least one even-even cell.
    phase2.bits[0] = query_assigned(cells2);
    phase2.chunks_got[0] = phase2.chunks_expected[0];

    while (phase2.remaining_chunks > 0) receive_one(phase1, phase2);
    apply_phase(cells2, phase2, open);

    if (find_path(open, path)) say_claim(path);
    return 0;
}
