// Problem : F - Three Variables Game
// Contest : AtCoder - AtCoder Beginner Contest 166
// URL : https://atcoder.jp/contests/abc166/tasks/abc166_f
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
ordered_set;	

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<pii, int> para;
const ll inf = 1e18 + 7;
const ll maxN = 1e5 + 1;
const ll MOD = 1e9 + 7;

int n, a, b, c;
string s[maxN];
vector<char> ans;

short dp[maxN][4][4][4];
bool nxt[maxN][4][4][4];

bool solve(int pos, int a, int b, int c) {
	if (a < 0 || b < 0 || c < 0) return false;
	a = min(a, 3);
	b = min(b, 3);
	c = min(c, 3);
	if (pos == n) return true;
	if (dp[pos][a][b][c] != -1) return dp[pos][a][b][c];
	
	bool found = false;
	if (s[pos] == "AB") {
		bool ok = solve(pos + 1, a - 1, b + 1, c);
		if (ok) nxt[pos][a][b][c] = 0, found = true;
		ok |= solve(pos + 1, a + 1, b - 1, c);
		if (ok && !found) nxt[pos][a][b][c] = 1;
		dp[pos][a][b][c] = ok;
		return ok;
	}
	if (s[pos] == "AC") {
		bool ok = solve(pos + 1, a - 1, b, c + 1);
		if (ok) nxt[pos][a][b][c] = 0, found = true;
		ok |= solve(pos + 1, a + 1, b,c - 1);
		if (ok && !found) nxt[pos][a][b][c] = 1;
		dp[pos][a][b][c] = ok;
		return ok;
	}
	if (s[pos] == "BC") {
		bool ok = solve(pos + 1, a, b - 1, c + 1);
		if (ok) nxt[pos][a][b][c] = 0, found = true;
		ok |= solve(pos + 1, a, b + 1, c - 1);
		if (ok && !found) nxt[pos][a][b][c] = 1;
		dp[pos][a][b][c] = ok;
		return ok;
	}
	assert(false);
}

void solveDP() {
	REP(pos, n) {
		REP(i, 4) {
			REP(j,4) {
				REP(k, 4) {
					dp[pos][i][j][k] = -1;
				}
			}
		}
	}
	solve(0, a, b, c);
}

// sprawdz MODULO!
int main() {
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin >> n >> a >> b >> c;
	ll sum = a + b + c;
	REP(i, n) {
		cin >> s[i];
		
	}
	a = min(a, 3);
	b = min(b, 3);
	c = min(c, 3);
	solveDP();
	if (dp[0][a][b][c]) {
		cout << "Yes\n";
		REP(i, n) {
			//cout << a << " " << b << " " << c << " " << nxt[i][a][b][c] << endl;
			cout << s[i][1 - nxt[i][a][b][c]] << "\n";
			if (nxt[i][a][b][c] == 1) {
				if (s[i] == "AB") {
					a++, b--;
				}
				if (s[i] == "AC") {
					a++, c--;
				}
				if (s[i] == "BC") {
					b++, c--;
				}
			} else {
				if (s[i] == "AB") {
					a--, b++;
				}
				if (s[i] == "AC") {
					a--, c++;
				}
				if (s[i] == "BC") {
					b--, c++;
				}
			}
			a = min(a, 3);
			b = min(b, 3);
			c = min(c, 3);
		}
	}
	else cout << "No\n";
	return 0;
}
 


Measured memory_bytes: 34908