import java.io.*;
import java.util.StringTokenizer;

class Interact {
    FastScanner data;
    FastScanner in;
    PrintWriter out;
    PrintWriter report;

    boolean doLog = false;
    PrintWriter log;

    final static int EXIT_BAD = 10;
    final static int MAX_CHECKS = 100;

    void solve() throws FileNotFoundException {
        int n = data.nextInt();
        int m = data.nextInt();
        // We shift data so that if participant reads our input, he doesn't learn correct p and v values ;)
        int p = data.nextInt();
        p = (p + 239) % (n + 1);
        int v = data.nextInt();
        v = (v + 239) % (m + 1);
        if (doLog) {
            log = new PrintWriter("log-" + n + "-" + m + "-" + p + "-" + v);
        }

        out.println(n + " " + m);
        out.flush();
        if (doLog) {
            log.println(">> " + n + " " + m);
            log.flush();
        }
        int nChecks = 0;
        while (true) {
            String s = in.next();
            if (s.equals("check")) {
                int l = in.nextInt();
                int r = in.nextInt();
                if (doLog) {
                    log.println("<< check " + l + " " + r);
                    log.flush();
                }
                if (r < l) {
                    report.println("-1");
                    report.println("Invalid segment to check: " + l + " " + r);
                    report.close();
                    System.exit(EXIT_BAD);
                }
                nChecks++;
                if (nChecks > MAX_CHECKS) {
                    report.println(nChecks);
                    report.close();
                    System.exit(EXIT_BAD);
                }
                if (l <= p && p <= r) {
                    out.println("Yes");
                    out.flush();
                    if (doLog) {
                        log.println(">> Yes");
                        log.flush();
                    }
                } else {
                    out.println("No");
                    out.flush();
                    if (doLog) {
                        log.println(">> No");
                        log.flush();
                    }
                }
            } else if (s.equals("answer")) {
                int x = in.nextInt();
                if (doLog) {
                    log.println("<< answer " + x);
                    log.flush();
                }
                if (x == p) {
                    report.println(nChecks);
                    report.close();
                    return;
                } else {
                    report.println(-1);
                    report.println("Point located incorrectly");
                    report.close();
                    return;
                }
            } else {
                report.println(-1);
                report.println("Invalid command " + s);
                report.close();
                System.exit(EXIT_BAD);
            }
            p += v;
        }
    }

    public void run() {
        try {
            data = new FastScanner(new FileInputStream("interactive.in"));
            report = new PrintWriter("interactive.out");
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(EXIT_BAD);
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String s = br.readLine();
                    if (s == null) {
                        report.println(-2);
                        report.println("Unexpected end of file");
                        System.exit(EXIT_BAD);
                    }
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    report.println(-2);
                    report.println(e.getMessage());
                    System.exit(EXIT_BAD);
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            String s = next();
            try {
                return Integer.parseInt(s);
            } catch (NumberFormatException e) {
                report.println(-2);
                report.println("Number expected instead of " + s);
                System.exit(EXIT_BAD);
                return 0;
            }
        }
    }

    public static void main(String[] arg) {
        new Interact().run();
    }
}