#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

const int MAX = 1e5 + 5;
bool dp[MAX][5][5][5];
int main()
{
	boost;
	int n, a, b, c;
	cin >> n >> a >> b >> c;
	memset(dp, 0, sizeof dp);
	
	for(int i = 0; i < 5; i++) {
		for(int j = 0; j < 5; j++) {
			for(int k = 0; k < 5; k++) {
				if(a >= i && b >= j && c >= k)
				dp[0][i][j][k] = 1;
			}
		}
	}
	vector <string> v;
	for(int i = 1; i <= n; i++) {
		string s;
		cin >> s;
		v.pb(s);
		if(s == "AB") {
			// A++, B--
			for(int j = 0; j < 4; j++) {
				for(int k = 1; k < 5; k++) {
					for(int l = 0; l < 5; l++) {
						if(dp[i - 1][j][k][l])
						dp[i][j + 1][k - 1][l] = 1;
					}
				}
			}
			// For A--,B++
			for(int j = 1; j < 5; j++) {
				for(int k = 0; k < 4; k++) {
					for(int l = 0; l < 5; l++) {
						if(dp[i - 1][j][k][l])
						dp[i][j - 1][k + 1][l] = 1;
					}
				}
			}
		}
		else if(s == "AC") {
			// A++, C--
			for(int j = 0; j < 4; j++) {
				for(int k = 0; k < 5; k++) {
					for(int l = 1; l < 5; l++) {
						if(dp[i - 1][j][k][l])
						dp[i][j + 1][k][l - 1] = 1;
					}
				}
			}
			// For A--, C++
			for(int j = 1; j < 5; j++) {
				for(int k = 0; k < 5; k++) {
					for(int l = 0; l < 4; l++) {
						if(dp[i - 1][j][k][l])
						dp[i][j - 1][k][l + 1] = 1;
					}
				}
			}
		}
		else {
			// B++, C--
			for(int j = 0; j < 5; j++) {
				for(int k = 0; k < 4; k++) {
					for(int l = 1; l < 5; l++) {
						if(dp[i - 1][j][k][l])
						dp[i][j][k + 1][l - 1] = 1;
					}
				}
			}
			// B--,C++
			for(int j = 0; j < 5; j++) {
				for(int k = 1; k < 5; k++) {
					for(int l = 0; l < 4; l++) {
						if(dp[i - 1][j][k][l])
						dp[i][j][k - 1][l + 1] = 1;
					}
				}
			}
		}
	}
	bool ok = 0;
	for(int i = 0; i < 5; i++) {
		for(int j = 0; j < 5; j++) {
			for(int k = 0; k < 5; k++) {
				if(dp[n][i][j][k]) {
					ok = 1;
					break;
				}
			}
		}
	}
	if(!ok) cout << "No";
	else {
		cout << "Yes\n";
		string ans = "";
		int ca = 4, cb = 4, cc = 4;
		for(int i = n; i > 0; i--) {
			string s = v[i - 1];
			bool ok = 0;
			if(s == "AB") {
				for(int j = ca; j >= 0; j--) {
					for(int k = cb; k >= 0; k--) {
						for(int l = cc; l >= 0; l--) {
							if(dp[i][j][k][l]) {
								if(j < 4 && k > 0 && dp[i - 1][j + 1][k - 1][l]) {
									ans += "B";
									ca = j + 1, cb = k - 1, cc = l;
									ok = 1;
									break;
								}
								if(k < 4 && j > 0 && dp[i - 1][j - 1][k + 1][l]) {
									ans += "A";
									ca = j - 1, cb = k + 1, cc = l;
									ok = 1;
									break;
								}
							}
						}
						if(ok) break;
					}
					if(ok) break;
				}
			}
			else if(s == "BC") {
				for(int j = ca; j >= 0; j--) {
					for(int k = cb; k >= 0; k--) {
						for(int l = cc; l >= 0; l--) {
							if(dp[i][j][k][l]) {
								if(k < 4 && l > 0 && dp[i - 1][j][k + 1][l - 1]) {
									ans += "C";
									ca = j, cb = k + 1, cc = l - 1;
									ok = 1;
									break;
								}
								if(k > 0 && l < 4 && dp[i - 1][j][k - 1][l + 1]) {
									ans += "B";
									ca = j, cb = k - 1, cc = l + 1;
									ok = 1;
									break;
								}
							}
						}
						if(ok) break;
					}
					if(ok) break;
				}
			}
			else {
				for(int j = ca; j >= 0; j--) {
					for(int k = cb; k >= 0; k--) {
						for(int l = cc; l >= 0; l--) {
							if(dp[i][j][k][l]) {
								if(j < 4 && l > 0 && dp[i - 1][j + 1][k][l - 1]) {
									ans += "C";
									ca = j + 1, cb = k, cc = l - 1;
									ok = 1;
									break;
								}
								if(j > 0 && l < 4 && dp[i - 1][j - 1][k][l + 1]) {
									ans += "A";
									ca = j - 1, cb = k, cc = l + 1;
									ok = 1;
									break;
								}
							}
						}
						if(ok) break;
					}
					if(ok) break;
				}
			}
		}
		reverse(all(ans));
		for(char c : ans)
		cout << c << '\n';
	}
}


Measured memory_bytes: 19628