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

void F(long long& A, long long& B, char C, char D) {
	if (A < B) {
		cout << C << endl;
		A++, B--;
	}
	else {
		cout << D << endl;
		A--, B++;
	}
}

int main() {
	long long N, A, B, C;
	cin >> N >> A >> B >> C;
	vector<string> S(N);
	for (int i = 0; i < N; i++) cin >> S[i];
	if (A >= 1 && B >= 1 && C >= 1) {
		cout << "Yes" << endl;
		for (int i = 0; i < N; i++) {
			if (S[i] == "AB") {
				F(A, B, 'A', 'B');
			}
			if (S[i] == "AC") {
				F(A, C, 'A', 'C');
			}
			if (S[i] == "BC") {
				F(B, C, 'B', 'C');
			}
		}
		return 0;
	}
	if (A == 0 && B == 0 && C == 0) {
		cout << "No" << endl;
		return 0;
	}
	if ((int)(A == 0) + (int)(B == 0) + (int)(C == 0) == 1) {
		if (A + B + C >= 3) {
			cout << "Yes" << endl;
			for (int i = 0; i < N; i++) {
				if (S[i] == "AB") {
					F(A, B, 'A', 'B');
				}
				if (S[i] == "AC") {
					F(A, C, 'A', 'C');
				}
				if (S[i] == "BC") {
					F(B, C, 'B', 'C');
				}
			}
			return 0;
		}
		else {
			static bool V[100010][3][3][3] = {};
			V[0][A][B][C] = true;
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < 3; j++) {
					for (int k = 0; k < 3; k++) {
						for (int l = 0; l < 3; l++) {
							if (V[i][j][k][l]) {
								if (S[i] == "AB") {
									if (j != 0) V[i + 1][j - 1][k + 1][l] = true;
									if (k != 0) V[i + 1][j + 1][k - 1][l] = true;
								}
								if (S[i] == "AC") {
									if (j != 0) V[i + 1][j - 1][k][l + 1] = true;
									if (l != 0) V[i + 1][j + 1][k][l - 1] = true;
								}
								if (S[i] == "BC") {
									if (k != 0) V[i + 1][j][k - 1][l + 1] = true;
									if (l != 0) V[i + 1][j][k + 1][l - 1] = true;
								}
							}
						}
					}
				}
			}
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j < 3; j++) {
					for (int k = 0; k < 3; k++) {
						if (V[N][i][j][k]) {
							cout << "Yes" << endl;
							int NA = i, NB = j, NC = k;
							vector<char> VC;
							for (int l = N - 1; l >= 0; l--) {
								if (S[l] == "AB") {
									if (NA != 0 && V[l][NA - 1][NB + 1][NC]) VC.push_back('A'), NA--, NB++;
									else if (NB != 0 && V[l][NA + 1][NB - 1][NC]) VC.push_back('B'), NA++, NB--;
								}
								if (S[l] == "AC") {
									if (NA != 0 && V[l][NA - 1][NB][NC + 1]) VC.push_back('A'), NA--, NC++;
									else if (NC != 0 && V[l][NA + 1][NB][NC - 1]) VC.push_back('C'), NA++, NC--;
								}
								if (S[l] == "BC") {
									if (NB != 0 && V[l][NA][NB - 1][NC + 1]) VC.push_back('B'), NB--, NC++;
									else if (NC != 0 && V[l][NA][NB + 1][NC - 1]) VC.push_back('C'), NB++, NC--;
								}
							}
							reverse(VC.begin(), VC.end());
							for (int i = 0; i < N; i++) cout << VC[i] << endl;
							return 0;
						}
					}
				}
			}
			cout << "No" << endl;
			return 0;
		}
	}
	if ((int)(A == 0) + (int)(B == 0) + (int)(C == 0) == 2) {
		if (A + B + C >= 3) {
			if (S[0] == "AB" && A == 0 && B == 0) {
				cout << "No" << endl;
				return 0;
			}
			if (S[0] == "AC" && A == 0 && C == 0) {
				cout << "No" << endl;
				return 0;
			}
			if (S[0] == "BC" && B == 0 && C == 0) {
				cout << "No" << endl;
				return 0;
			}
			if (A + B + C >= 3) {
				cout << "Yes" << endl;
				for (int i = 0; i < N; i++) {
					if (S[i] == "AB") {
						F(A, B, 'A', 'B');
					}
					if (S[i] == "AC") {
						F(A, C, 'A', 'C');
					}
					if (S[i] == "BC") {
						F(B, C, 'B', 'C');
					}
				}
				return 0;
			}
		}
		else {
			static bool V[100010][3][3][3] = {};
			V[0][A][B][C] = true;
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < 3; j++) {
					for (int k = 0; k < 3; k++) {
						for (int l = 0; l < 3; l++) {
							if (V[i][j][k][l]) {
								if (S[i] == "AB") {
									if (j != 0) V[i + 1][j - 1][k + 1][l] = true;
									if (k != 0) V[i + 1][j + 1][k - 1][l] = true;
								}
								if (S[i] == "AC") {
									if (j != 0) V[i + 1][j - 1][k][l + 1] = true;
									if (l != 0) V[i + 1][j + 1][k][l - 1] = true;
								}
								if (S[i] == "BC") {
									if (k != 0) V[i + 1][j][k - 1][l + 1] = true;
									if (l != 0) V[i + 1][j][k + 1][l - 1] = true;
								}
							}
						}
					}
				}
			}
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j < 3; j++) {
					for (int k = 0; k < 3; k++) {
						if (V[N][i][j][k]) {
							cout << "Yes" << endl;
							int NA = i, NB = j, NC = k;
							vector<char> VC;
							for (int l = N - 1; l >= 0; l--) {
								if (S[l] == "AB") {
									if (NA != 0 && V[l][NA - 1][NB + 1][NC]) VC.push_back('A'), NA--, NB++;
									else if (NB != 0 && V[l][NA + 1][NB - 1][NC]) VC.push_back('B'), NA++, NB--;
								}
								if (S[l] == "AC") {
									if (NA != 0 && V[l][NA - 1][NB][NC + 1]) VC.push_back('A'), NA--, NC++;
									else if (NC != 0 && V[l][NA + 1][NB][NC - 1]) VC.push_back('C'), NA++, NC--;
								}
								if (S[l] == "BC") {
									if (NB != 0 && V[l][NA][NB - 1][NC + 1]) VC.push_back('B'), NB--, NC++;
									else if (NC != 0 && V[l][NA][NB + 1][NC - 1]) VC.push_back('C'), NB++, NC--;
								}
							}
							reverse(VC.begin(), VC.end());
							for (int i = 0; i < N; i++) cout << VC[i] << endl;
							return 0;
						}
					}
				}
			}
			cout << "No" << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 9320