#include <bits/stdc++.h>
using namespace std;

const int N = 1e5+69;
vector<int> pos[3];
string s[N];
char step[N];
int tot[3];

int main(){
 ios_base::sync_with_stdio(0);
 cin.tie(0), cout.tie(0);

 int n,a,b,c;
 cin >> n >> a >> b >> c;
 bool ok = true;
 string first;

 for(int i=1; i<=n; i++){
 	cin >> s[i];
 	// if(s[i]=="AB") {pos[0].push_back(i); tot[0]++;}
 	// else if(s[i]=="BC") {pos[1].push_back(i); tot[1]++;}
 	// else if(s[i]=="AC") {pos[2].push_back(i); tot[2]++;}
 }

 if(a+b+c==0) ok = false;
 if(s[1]=="AB" && (a==0) && (b==0)) ok = false;
 if(s[1]=="BC" && (c==0) && (b==0)) ok = false;
 if(s[1]=="AC" && (a==0) && (c==0)) ok = false;

 if(!ok) {
 	cout << "No\n";
 	return 0;
 }

 //assume di awal ga mati langsung
 if(a+b+c==1){
 	vector<int> ve;
 	int cur;
 	if(a==1) cur=0; 
 	else if(b==1) cur=1; 
 	else cur=2;
 	for(int i=1; i<=n; i++){
 		if(s[i]=="AB"){
 			if(cur==0) cur=1;
 			else if(cur==1) cur=0;
 			else {ok = false; break;}
 		} else if(s[i]=="BC"){
 			if(cur==1) cur=2;
 			else if(cur==2) cur=1;
 			else {ok = false; break;}
 		} else if(s[i]=="AC"){
 			if(cur==0) cur=2;
 			else if(cur==2) cur=0;
 			else {ok = false; break;}
 		}
 		ve.push_back(cur);
 	}
 	if(ok){
 		cout << "Yes\n";
 		for(auto i : ve){
 			cout << (char) (i+65) << "\n";
 		}
 	} else {
 		cout << "No\n";
 	}
 	return 0;
 }

 cout << "Yes\n";
 vector<int> ve;

 	if(s[1]=="AB"){
 		if(a==0) {ve.push_back(0); b--; a++;}
 		else if(b==0) {ve.push_back(1); a--; b++;}
 		else {ve.push_back(1); a--; b++;}
 	} else if(s[1]=="BC"){
 		if(b==0) {ve.push_back(1); c--; b++;}
 		else if(c==0) {ve.push_back(2); b--; c++;}
 		else {ve.push_back(2); b--; c++;}
 	} else if(s[1]=="AC"){
 		if(a==0) {ve.push_back(0); c--; a++;}
 		else if(c==0) {ve.push_back(2); a--; c++;}
 		else {ve.push_back(0); c--; a++;}
 	}

 for(int i=2; i<=n; i++){
 	if(s[i]=="AB"){
 		if(a==0 && b==0){
 			if(s[i-1]=="BC"){
 				b+=2; c-=2; ve.pop_back(); ve.push_back(1);
 				b--; a++; ve.push_back(0);
 			}
 			else if(s[i-1]=="AC"){
 				a+=2; c-=2; ve.pop_back(); ve.push_back(0);
 				a--; b++; ve.push_back(1);
 			} 
 		} else if(a==0){
 			ve.push_back(0); b--; a++;
 		} else if(b==0){
 			ve.push_back(1); b++; a--;
 		} else {
 			ve.push_back(1); a--; b++;
 		}
 	} else if(s[i]=="BC"){
 		if(c==0 && b==0){
 			if(s[i-1]=="AC"){
 				c+=2; a-=2; ve.pop_back(); ve.push_back(2);
 				c--; b++; ve.push_back(1);
 			}
 			else if(s[i-1]=="AB"){
 				b+=2; a-=2; ve.pop_back(); ve.push_back(1);
 				b--; c++; ve.push_back(2);
 			}
 		} else if(b==0){
 			ve.push_back(1); c--; b++;
 		} else if(c==0){
 			ve.push_back(2); b--; c++;
 		} else {
 			ve.push_back(2); b--; c++;
 		}
 	} else if(s[i]=="AC"){
 		// cerr << "kuntul";
 		if(a==0 && c==0){
 			if(s[i-1]=="BC"){
 				c+=2; b-=2; ve.pop_back(); ve.push_back(2);
 				ve.push_back(0); c--; a++;
 			}
 			else if(s[i-1]=="AB"){
 				// cerr<<"kuntul";
 				a+=2; b-=2; ve.pop_back(); ve.push_back(0);
 				ve.push_back(2); a--; c++;
 			}
 		} else if(a==0){
 			ve.push_back(0); c--; a++;
 		} else if(c==0){
 			ve.push_back(2); a--; c++;
 		} else {
 			ve.push_back(0); c--; a++;
 		}
 	}
 }

 for(auto i : ve){
		cout << (char) (i+65) << "\n";
	}

}

Measured memory_bytes: 7064