#include <stdio.h>

static unsigned int x=123456789;
static unsigned int y=362436069;
static unsigned int z=521288629;
static unsigned int w=88675123;

void seed(unsigned int a,unsigned int b,unsigned int c,unsigned int d) {
	if((a|b|c|d)==0)return;
	x=a;y=b;z=c;w=d;
}

unsigned int randint(void) {
	unsigned int t;
	t=(x^(x<<11));
	x=y;y=z;z=w;
	w=(w^(w>>19))^(t^(t>>8));
	return w;
}

int N, A, B, C;
char s[114514][4];

int nokori[114514][3];

int desicion[114514];

int main(void) {
	int i;
	int nyan[3];
	if (scanf("%d%d%d%d", &N, &A, &B, &C) != 4) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%3s", s[i]) != 1) return 1;
		nokori[i][s[i][0] - 'A']++;
		nokori[i][s[i][1] - 'A']++;
	}
	for (i = N - 2; i >= 0; i--) {
		nokori[i][0] += nokori[i + 1][0];
		nokori[i][1] += nokori[i + 1][1];
		nokori[i][2] += nokori[i + 1][2];
	}
	nyan[0] = A;
	nyan[1] = B;
	nyan[2] = C;
	for (i = 0; i < N; i++) {
		int x = s[i][0] - 'A';
		int y = s[i][1] - 'A';
		int sx = nyan[x] - nokori[i][x];
		int sy = nyan[y] - nokori[i][y];
		int decide_x_minus;
		if (nyan[x] == 0) decide_x_minus = 0;
		else if (nyan[y] == 0) decide_x_minus = 1;
		else if (sx > sy) decide_x_minus = 1;
		else if (sx < sy) decide_x_minus = 0;
		else if (nyan[x] > nyan[y]) decide_x_minus = 1;
		else if (nyan[x] < nyan[y]) decide_x_minus = 0;
		else decide_x_minus = randint() % 2;

		if (decide_x_minus) {
			if (nyan[x] <= 0) {
				puts("No");
				return 0;
			}
			nyan[x]--;
			nyan[y]++;
			desicion[i] = y;
		} else {
			if (nyan[y] <= 0) {
				puts("No");
				return 0;
			}
			nyan[x]++;
			nyan[y]--;
			desicion[i] = x;
		}
	}

	puts("Yes");
	for (i = 0; i < N; i++) {
		printf("%c\n", 'A' + desicion[i]);
	}
	return 0;
}
