//F
//Author : Sidiq Tri Pratikto
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(v) v.begin(), v.end()

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set;
//order_of_key(x) = number of elements stricly smaller than x
//find_by_order(x) = return x-th largest element
typedef long long LL;
const LL MOD = 1e9 + 7;
const double PI = 2 * acos(0);

int main() {
	int N, A, B, C;
	scanf("%d%d%d%d", &N, &A, &B, &C);
	string arr[N + 1];
	for (int i = 1; i <= N; i++) {
		cin >> arr[i];
	}
	if (A + B + C == 0) printf("No\n");
	else if (A + B + C == 1) {
		vector<char> ans;
		for (int i = 1; i <= N; i++) {
			int satu, dua;
			if (arr[i][0] == 'A') satu = A;
			else if (arr[i][0] == 'B') satu = B;
			else satu = C;
			if (arr[i][1] == 'A') dua = A;
			else if (arr[i][1] == 'B') dua = B;
			else dua = C;
			if (satu == 0 && dua == 0) {
				printf("No\n");
				return 0;
			}
			if (satu == 1) {
				if (arr[i][0] == 'A') A--;
				else if (arr[i][0] == 'B') B--;
				else C--;
				if (arr[i][1] == 'A') A++, ans.pb('A');
				else if (arr[i][1] == 'B') B++, ans.pb('B');
				else C++, ans.pb('C');
			} else {
				if (arr[i][1] == 'A') A--;
				else if (arr[i][1] == 'B') B--;
				else C--;
				if (arr[i][0] == 'A') A++, ans.pb('A');
				else if (arr[i][0] == 'B') B++, ans.pb('B');
				else C++, ans.pb('C');
			}		
		}
		printf("Yes\n");
		for (auto i : ans) cout << i << "\n";
	} else if (A + B + C == 2) {
		vector<char> ans;
		for (int i = 1; i <= N; i++) {
			int satu, dua;
			if (arr[i][0] == 'A') satu = A;
			else if (arr[i][0] == 'B') satu = B;
			else satu = C;
			if (arr[i][1] == 'A') dua = A;
			else if (arr[i][1] == 'B') dua = B;
			else dua = C;
			if (satu == 0 && dua == 0) {
				printf("No\n");
				return 0;
			}
			if (satu > dua) {
				if (arr[i][0] == 'A') A--;
				else if (arr[i][0] == 'B') B--;
				else C--;
				if (arr[i][1] == 'A') A++, ans.pb('A');
				else if (arr[i][1] == 'B') B++, ans.pb('B');
				else C++, ans.pb('C');
			} else if (satu < dua) {
				if (arr[i][1] == 'A') A--;
				else if (arr[i][1] == 'B') B--;
				else C--;
				if (arr[i][0] == 'A') A++, ans.pb('A');
				else if (arr[i][0] == 'B') B++, ans.pb('B');
				else C++, ans.pb('C');
			} else if (i < N) {
				if (arr[i] == "AB") {
					if (arr[i + 1] == "AB") {
						if (arr[i][0] == 'A') A--;
						else if (arr[i][0] == 'B') B--;
						else C--;
						if (arr[i][1] == 'A') A++, ans.pb('A');
						else if (arr[i][1] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					} else if (arr[i + 1] == "AC") {
						if (arr[i][1] == 'A') A--;
						else if (arr[i][1] == 'B') B--;
						else C--;
						if (arr[i][0] == 'A') A++, ans.pb('A');
						else if (arr[i][0] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					} else {
						if (arr[i][0] == 'A') A--;
						else if (arr[i][0] == 'B') B--;
						else C--;
						if (arr[i][1] == 'A') A++, ans.pb('A');
						else if (arr[i][1] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					}
				} else if (arr[i] == "AC") {
					if (arr[i + 1] == "AB") {
						if (arr[i][1] == 'A') A--;
						else if (arr[i][1] == 'B') B--;
						else C--;
						if (arr[i][0] == 'A') A++, ans.pb('A');
						else if (arr[i][0] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					} else if (arr[i + 1] == "AC") {
						if (arr[i][1] == 'A') A--;
						else if (arr[i][1] == 'B') B--;
						else C--;
						if (arr[i][0] == 'A') A++, ans.pb('A');
						else if (arr[i][0] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					} else {
						if (arr[i][0] == 'A') A--;
						else if (arr[i][0] == 'B') B--;
						else C--;
						if (arr[i][1] == 'A') A++, ans.pb('A');
						else if (arr[i][1] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					}
				} else {
					if (arr[i + 1] == "AB") {
						if (arr[i][1] == 'A') A--;
						else if (arr[i][1] == 'B') B--;
						else C--;
						if (arr[i][0] == 'A') A++, ans.pb('A');
						else if (arr[i][0] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					} else if (arr[i + 1] == "AC") {
						if (arr[i][0] == 'A') A--;
						else if (arr[i][0] == 'B') B--;
						else C--;
						if (arr[i][1] == 'A') A++, ans.pb('A');
						else if (arr[i][1] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					} else {
						if (arr[i][0] == 'A') A--;
						else if (arr[i][0] == 'B') B--;
						else C--;
						if (arr[i][1] == 'A') A++, ans.pb('A');
						else if (arr[i][1] == 'B') B++, ans.pb('B');
						else C++, ans.pb('C');
					}
				}
			} else {
				if (arr[i][0] == 'A') A--;
				else if (arr[i][0] == 'B') B--;
				else C--;
				if (arr[i][1] == 'A') A++, ans.pb('A');
				else if (arr[i][1] == 'B') B++, ans.pb('B');
				else C++, ans.pb('C');
			}
		}
		printf("Yes\n");
		for (auto i : ans) cout << i << "\n";
	} else {
		vector<char> ans;
		for (int i = 1; i <= N; i++) {
			int satu, dua;
			if (arr[i][0] == 'A') satu = A;
			else if (arr[i][0] == 'B') satu = B;
			else satu = C;
			if (arr[i][1] == 'A') dua = A;
			else if (arr[i][1] == 'B') dua = B;
			else dua = C;
			if (satu == 0 && dua == 0) {
				printf("No\n");
				return 0;
			}
			if (satu >= dua) {
				if (arr[i][0] == 'A') A--;
				else if (arr[i][0] == 'B') B--;
				else C--;
				if (arr[i][1] == 'A') A++, ans.pb('A');
				else if (arr[i][1] == 'B') B++, ans.pb('B');
				else C++, ans.pb('C');
			} else {
				if (arr[i][1] == 'A') A--;
				else if (arr[i][1] == 'B') B--;
				else C--;
				if (arr[i][0] == 'A') A++, ans.pb('A');
				else if (arr[i][0] == 'B') B++, ans.pb('B');
				else C++, ans.pb('C');
			}		
		}
		printf("Yes\n");
		for (auto i : ans) cout << i << "\n";
	}
}

Measured memory_bytes: 6940