import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { try (Scanner sc = new Scanner(System.in)) { int h = sc.nextInt(); int w = sc.nextInt(); Color[][] map = new Color[h][w]; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { map[y][x] = (x + y) % 2 == 0 ? Color.white : Color.black; } } int n = sc.nextInt(); for (int i = 0; i < n; i++) { String s = sc.next(); int k = sc.nextInt(); switch (s) { case "R": { Color t = map[k][w - 1]; for (int x = w - 1; x >= 1; x--) { map[k][x] = map[k][x - 1]; } map[k][0] = t; break; } case "C": { Color t = map[h - 1][k]; for (int y = h - 1; y >= 1; y--) { map[y][k] = map[y - 1][k]; } map[0][k] = t; break; } } } System.out.println(map[0][0]); } } // static void print(Color[][] map) { // for (int y = 0; y < map.length; y++) { // for (int x = 0; x < map[y].length; x++) { // System.err.print(map[y][x]); // System.err.print(" "); // } // System.err.println(); // } // } } enum Color { black, white; }