#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <cmath>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>
#include <time.h>
#include <bitset>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }

ll N, A, B, C;
string s[112345];
int si[112345];
int memo[112345][3][3][3];

bool dp(int i, int a, int b, int c) {
	if (memo[i][a][b][c] != -1) return !!memo[i][a][b][c];
	if (a < 0 || b < 0 || c < 0) return false;
	if (i == N) return true;
	int n[3] = { a, b, c };
	if (n[si[i]] == 0 && n[(si[i] + 1) % 3] == 0) return false;
	if (a == 2 || b == 2 || c == 2) {
		if (n[si[i]] == 2) {
			n[si[i]]--;
			n[(si[i] + 1) % 3]++;
		}
		else {
			n[si[i]]++;
			n[(si[i] + 1) % 3]--;
		}
		return memo[i][a][b][c] = dp(i + 1, n[0], n[1], n[2]) ? 1 : 0;
	}
	else {
		switch (si[i]) {
		case 0:
			return memo[i][a][b][c] = dp(i + 1, a + 1, b - 1, c) || dp(i + 1, a - 1, b + 1, c);
		case 1:
			return memo[i][a][b][c] = dp(i + 1, a, b + 1, c - 1) || dp(i + 1, a, b - 1, c + 1);
		case 2:
			return memo[i][a][b][c] = dp(i + 1, a - 1, b, c + 1) || dp(i + 1, a + 1, b, c - 1);
		}
	}
}

bool out = false;
vector<int> outbuf;
bool dpout(int i, int a, int b, int c) {
	if (memo[i][a][b][c] != -1) return !!memo[i][a][b][c];
	if (a < 0 || b < 0 || c < 0) return false;
	if (i == N) {
		if (out) {
			return false;
		}
		return true;
	}
	int n[3] = { a, b, c };
	if (n[si[i]] == 0 && n[(si[i] + 1) % 3] == 0) return false;
	if (a == 2 || b == 2 || c == 2) {
		if (n[si[i]] == 2) {
			n[si[i]]--;
			n[(si[i] + 1) % 3]++;
		}
		else {
			n[si[i]]++;
			n[(si[i] + 1) % 3]--;
		}
		memo[i][a][b][c] = dpout(i + 1, n[0], n[1], n[2]) ? 1 : 0;
		if (memo[i][a][b][c] == 1) {
			n[0] = a; n[1] = b; n[2] = c;
			if (n[si[i]] == 2) {
				outbuf.push_back((si[i] + 1) % 3);
			}
			else {
				outbuf.push_back(si[i]);
			}
		}
		return memo[i][a][b][c];
	}
	else {
		switch (si[i]) {
		case 0:
			memo[i][a][b][c] = dpout(i + 1, a + 1, b - 1, c) || dpout(i + 1, a - 1, b + 1, c);
			if (dpout(i + 1, a + 1, b - 1, c)) outbuf.push_back(0);
			else outbuf.push_back(1);
			return memo[i][a][b][c];
		case 1:
			memo[i][a][b][c] = dpout(i + 1, a, b + 1, c - 1) || dpout(i + 1, a, b - 1, c + 1);
			if (dpout(i + 1, a, b + 1, c - 1)) outbuf.push_back(1);
			else outbuf.push_back(2);
			return memo[i][a][b][c];
		case 2:
			memo[i][a][b][c] = dpout(i + 1, a - 1, b, c + 1) || dpout(i + 1, a + 1, b, c - 1);
			if (dpout(i + 1, a - 1, b, c + 1)) outbuf.push_back(2);
			else outbuf.push_back(0);
			return memo[i][a][b][c];
		}
	}
}

int main() {

	memset(memo, 0xff, sizeof(memo));
	cin >> N >> A >> B >> C;
	ll n[3];
	n[0] = A;
	n[1] = B;
	n[2] = C;
	rep(i, N) {
		cin >> s[i];
		if (s[i] == "AB") si[i] = 0;
		if (s[i] == "BC") si[i] = 1;
		if (s[i] == "AC") si[i] = 2;
	}
	if (A + B + C != 2) {
		vector<int> ans;
		rep(i, N) {
			if (n[si[i]] < n[(si[i] + 1) % 3]) {
				ans.push_back(si[i]);
				n[(si[i] + 1) % 3]--;
				n[si[i]]++;
			}
			else {
				ans.push_back((si[i] + 1) % 3);
				n[(si[i] + 1) % 3]++;
				n[si[i]]--;
			}
			if (n[0] < 0 || n[1] < 0 || n[2] < 0) {
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;
		rep(i, N) {
			if (ans[i] == 0) cout << "A" << endl;
			if (ans[i] == 1) cout << "B" << endl;
			if (ans[i] == 2) cout << "C" << endl;
		}
		return 0;
	}
	else {
		auto f = dp(0, A, B, C);
		if (f) {
			memset(memo, 0xff, sizeof(memo));
			cout << "Yes" << endl;
			dpout(0, A, B, C);
			rep(i, N) {
				if (outbuf[N - 1 - i] == 0) cout << "A" << endl;
				if (outbuf[N - 1 - i] == 1) cout << "B" << endl;
				if (outbuf[N - 1 - i] == 2) cout << "C" << endl;
			}
		}
		else {
			cout << "No" << endl;
		}
	}

	return 0;
}


Measured memory_bytes: 33612