#include<bits/stdc++.h>
using namespace std ;
#define Next( i, x ) for( register int i = head[x]; i; i = e[i].next )
#define rep( i, s, t ) for( register int i = (s); i <= (t); ++ i )
#define drep( i, s, t ) for( register int i = (t); i >= (s); -- i )
#define re register
int gi() {
	char cc = getchar() ; int cn = 0, flus = 1 ;
	while( cc < '0' || cc > '9' ) {  if( cc == '-' ) flus = - flus ; cc = getchar() ; }
	while( cc >= '0' && cc <= '9' )  cn = cn * 10 + cc - '0', cc = getchar() ;
	return cn * flus ;
}
const int N = 1e5 + 5 ; 
const int M = 15 ; 
int n, A, B, C, S, top ; 
int ans[N], w[M], Id[N], qr[N], cnt, yu[N] ; 
char s[N][5], st[N][5] ;
void solve1() {
	int fl = 1, bef = 1 ; qr[1] = 1 ; 
	int bA = A, bB = B, bC = C ; 
	rep( i, 1, n ) {
		if( ( s[i][1] == s[i + 1][1] ) && ( s[i][2] == s[i + 1][2] ) ) {
			++ fl, qr[i + 1] = qr[i] ; 
	//		printf("%d %d %d %d\n", i, fl, i + 1, qr[i + 1] ) ;
		}
		else {
			if( fl % 2 ) st[++ top][1] = s[i][1], st[top][2] = s[i][2], w[top] = 1 ; 
			else {
				st[++ top][1] = s[i][1], st[top][2] = s[i][2], w[top] = 2 ; 
				st[++ top][1] = s[i][1], st[top][2] = s[i][2], w[top] = 2 ; 	
			}
			yu[top] = bef, bef = i + 1, qr[i + 1] = i + 1, fl = 1 ; 
		}
	}
	rep( i, 1, top ) {
//		cout << st[i][1] << " " << st[i][2] << " iMAKF" << endl ; 
	//	printf("%d %d %d %d\n", A, B, C, w[top] ) ; 
		if( st[i][1] == 'A' && st[i][2] == 'B' ) {
			if( A == 0 && B == 0 ) {
				puts("No") ; exit(0) ;
			}
			if( A > B ) -- A, ++ B, Id[yu[i]] = 2 ; 
			else if( A < B ) ++ A, -- B, Id[yu[i]] = 1 ; 
			else {
				if( i == top ) Id[yu[i]] = 1 ; 
				else {
					if( st[i + 1][1] == 'A' || st[i + 1][2] == 'A' ) {
						++ A, -- B, Id[yu[i]] = 1 ; 
					}
					else {
						++ B, -- A, Id[yu[i]] = 2 ; 
					}
				}
			}
		}
		if( st[i][1] == 'A' && st[i][2] == 'C' ) {
			if( A == 0 && C == 0 ) {
				exit(0) ;
			}
			if( A > C ) -- A, ++ C, Id[yu[i]] = 3 ; 
			else if( A < C ) ++ A, -- C, Id[yu[i]] = 1 ; 
			else {
				if( i == top ) Id[yu[i]] = 1 ; 
				else {
					if( st[i + 1][1] == 'A' || st[i + 1][2] == 'A' ) {
						++ A, -- C, Id[yu[i]] = 1 ; 
					}
					else {
						++ C, -- A, Id[yu[i]] = 3 ; 
					}
				}
			}
		}
		if( st[i][1] == 'B' && st[i][2] == 'C' ) {
			if( C == 0 && B == 0 ) {
				puts("No") ; exit(0) ;
			}
			if( B > C ) -- B, ++ C, Id[yu[i]] = 3 ; 
			else if( C > B ) ++ B, -- C, Id[yu[i]] = 2 ; 
			else {
				if( i == top ) Id[yu[i]] = 3 ;
				else {
					if( st[i + 1][1] == 'B' || st[i + 1][2] == 'B' ) {
						++ B, -- C, Id[yu[i]] = 2 ; 
					}
					else {
						++ C, -- B, Id[yu[i]] = 3 ; 
					}
				}
			}
		}
	}
	A = bA, B = bB, C = bC ;
//	puts("Pass") ;
	rep( i, 1, n ) {
	//	printf("%d %d %d %d %d (%d)\n", qr[i], i, A, B, C, Id[i] ) ;
		if( s[i][1] == 'A' && s[i][2] == 'B' ) {
			if( A > B ) ans[i] = 'B', -- A, ++ B ;
			else if( B > A ) ans[i] = 'A', -- B, ++ A ;
			else if( Id[qr[i]] == 1 ) ans[i] = 'A', ++ A, -- B ; 
			else ans[i] = 'B', ++ B, -- A ;
		}
		if( s[i][1] == 'A' && s[i][2] == 'C' ) {	
			if( A > C ) ans[i] = 'C', -- A, ++ C ; 
			else if( C > A ) ans[i] = 'A', ++ A, -- C ; 
			else if( Id[qr[i]] == 1 ) ans[i] = 'A', ++ A, -- C ; 
			else ans[i] = 'C', ++ C, -- A ;
		}
		if( s[i][1] == 'B' && s[i][2] == 'C' ) {
			if( B > C ) ans[i] = 'C', -- B, ++ C ;
			else if( C > B ) ans[i] = 'B', -- C, ++ B ; 
			else if( Id[qr[i]] == 3 ) ans[i] = 'C', ++ C, -- B ; 
			else ans[i] = 'B', ++ B, -- C ;
		}
	//	printf("%d %d %d %d %d (%d)\n", qr[i], i, A, B, C, Id[i] ) ;
		if( min( A, min( B, C ) ) < 0 ) {
			puts("No") ; exit(0) ; 
		}
	}
	puts("Yes") ; 
	rep( i, 1, n ) printf("%c\n", ans[i] ) ;
}
void solve2() {
	rep( i, 1, n ) {
		if( s[i][1] == 'A' && s[i][2] == 'B' ) {
			if( A > B ) ans[i] = 'B', -- A, ++ B ;
			else ans[i] = 'A', -- B, ++ A ;
		}
		if( s[i][1] == 'A' && s[i][2] == 'C' ) {
			if( A > C ) ans[i] = 'C', -- A, ++ C ; 
			else ans[i] = 'A', ++ A, -- C ; 
		}
		if( s[i][1] == 'B' && s[i][2] == 'C' ) {
			if( B > C ) ans[i] = 'C', -- B, ++ C ;
			else ans[i] = 'B', -- C, ++ B ; 
		}
		if( min( A, min( B, C ) ) < 0 ) {
			puts("No") ; exit(0) ; 
		}
	}
	puts("Yes") ; 
	rep( i, 1, n ) printf("%c\n", ans[i] ) ;
}
signed main()
{
	n = gi(), A = gi(), B = gi(), C = gi() ;
	rep( i, 1, n ) scanf("%s", s[i] + 1 ) ;
	int S = A + B + C ; 
	if( S == 2 ) solve1() ; 
	else solve2() ;
	return 0 ;
}


Measured memory_bytes: 6120