#include <stdio.h>
int aa, bb, cc;
int n, a, b, c, f, t;
char s[3];
int x[100000];
int main() {
	scanf("%d%d%d%d", &n, &a, &b, &c);
	aa = a; bb = b; cc = c;
	for (int i = 0; i < n; i++) {
		scanf(" %s", s);
		if (s[0] == 'A' && s[1] == 'B')x[i] = 2;
		if (s[0] == 'A' && s[1] == 'C')x[i] = 1;
		if (s[0] == 'B' && s[1] == 'C')x[i] = 0;
	}
	for (int i = 0; i < n; i++) {
		t = 1;
		if (x[i] == 0) {
			if (b == 0 && c == 0)f = 1;
			if (a == 0 && b == 1 && c == 1 && i != n - 1) {
				t = 0; i++;
				if (x[i] == 0) {
					//printf("B\nC\n");
				}
				if (x[i] == 1) {
					//printf("C\nA\n");
					a++;
					b--;
				}
				if (x[i] == 2) {
					//printf("B\nA\n");
					a++;
					c--;
				}
			}
			else {
				if (b < c) {
					//printf("B\n");
					b++;
					c--;
				}
				else {
					//printf("C\n");
					c++;
					b--;
				}
			}
		}
		if (x[i] == 1 && t) {
			if (a == 0 && c == 0)f = 1;
			if (a == 1 && b == 0 && c == 1 && i != n - 1) {
				t = 0; i++;
				if (x[i] == 1) {
					//printf("C\nA\n");
				}
				if (x[i] == 2) {
					//printf("A\nB\n");
					b++;
					c--;
				}
				if (x[i] == 0) {
					//printf("C\nB\n");
					b++;
					a--;
				}
			}
			else {
				if (c < a) {
					//printf("C\n");
					c++;
					a--;
				}
				else {
					//printf("A\n");
					a++;
					c--;
				}
			}
		}
		if (x[i] == 2 && t) {
			if (a == 0 && b == 0)f = 1;
			if (a == 1 && b == 1 && c == 0 && i != n - 1) {
				i++;
				if (x[i] == 2) {
					//printf("A\nB\n");
				}
				if (x[i] == 0) {
					//printf("B\nC\n");
					c++;
					a--;
				}
				if (x[i] == 1) {
					//printf("A\nC\n");
					c++;
					b--;
				}
			}
			else {
				if (a < b) {
					//printf("A\n");
					a++;
					b--;
				}
				else {
					//printf("B\n");
					b++;
					a--;
				}
			}
		}
	}
	if (f) {
		printf("No\n");
		return 0;
	}
	printf("Yes\n");
	a = aa; b = bb; c = cc;
	for (int i = 0; i < n; i++) {
		t = 1;
		if (x[i] == 0) {
			if (b == 0 && c == 0)f = 1;
			if (a == 0 && b == 1 && c == 1 && i != n - 1) {
				t = 0; i++;
				if (x[i] == 0) {
					printf("B\nC\n");
				}
				if (x[i] == 1) {
					printf("C\nA\n");
					a++;
					b--;
				}
				if (x[i] == 2) {
					printf("B\nA\n");
					a++;
					c--;
				}
			}
			else {
				if (b < c) {
					printf("B\n");
					b++;
					c--;
				}
				else {
					printf("C\n");
					c++;
					b--;
				}
			}
		}
		if (x[i] == 1 && t) {
			if (a == 0 && c == 0)f = 1;
			if (a == 1 && b == 0 && c == 1 && i != n - 1) {
				t = 0; i++;
				if (x[i] == 1) {
					printf("C\nA\n");
				}
				if (x[i] == 2) {
					printf("A\nB\n");
					b++;
					c--;
				}
				if (x[i] == 0) {
					printf("C\nB\n");
					b++;
					a--;
				}
			}
			else {
				if (c < a) {
					printf("C\n");
					c++;
					a--;
				}
				else {
					printf("A\n");
					a++;
					c--;
				}
			}
		}
		if (x[i] == 2 && t) {
			if (a == 0 && b == 0)f = 1;
			if (a == 1 && b == 1 && c == 0 && i != n - 1) {
				i++;
				if (x[i] == 2) {
					printf("A\nB\n");
				}
				if (x[i] == 0) {
					printf("B\nC\n");
					c++;
					a--;
				}
				if (x[i] == 1) {
					printf("A\nC\n");
					c++;
					b--;
				}
			}
			else {
				if (a < b) {
					printf("A\n");
					a++;
					b--;
				}
				else {
					printf("B\n");
					b++;
					a--;
				}
			}
		}
	}
}

Measured memory_bytes: 2024