//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
//#pragma GCC target("avx,avx2")
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")

//# include <x86intrin.h>
# include <bits/stdc++.h>

# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;
 
template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
int n, m, k;
string s;
string t[N];
int cnt[N][3];
set  <pair<int, pair<int, int> > > u[N];

void solve (int A, int B, int C, int p = 1) {
	if(A < 0 || B < 0 || C < 0) return;

	A = min(A, cnt[p][0]);
	B = min(B, cnt[p][1]);
	C = min(C, cnt[p][2]);
	if (u[p].count(mp(A, mp(B, C)))) return ;
	u[p].insert({A, {B, C}});


	if (p > n) {
		cout << "Yes\n";
		for (auto it : s) cout << it << '\n';
		exit(0);
	}

	if (t[p] == "AB") {
		if (cnt[p][0] <= A) {
			s += 'B';
			solve(A-1, B+1, C, p+1);
			s.pop_back();
				
		} else if (cnt[p][1] <= B) {
			s += 'A';
			solve(A+1, B-1, C, p+1);
			s.pop_back();
				
		} else {
		    if (A > B) {
		    	s += 'B';
				solve(A-1, B+1, C, p+1);

				s.pop_back();
				
				s += 'A';
		    	solve(A+1, B-1, C, p+1);
		    	s.pop_back();
				
		    } else {
		    	s += 'A';
		    	solve(A+1, B-1, C, p+1);
		        s.pop_back();
				s += 'B';
		    	solve(A-1, B+1, C, p+1);
		    	s.pop_back();
				
		    }
		}
	}

	if (t[p] == "AC") {
		if (cnt[p][0] <= A) {
			s += 'C';
			solve(A-1, B, C+1, p+1);
			s.pop_back();
				
		} else if (cnt[p][2] <= C) {
			s += 'A';
			solve(A+1, B, C-1, p+1);
			s.pop_back();
				
		} else {
		    if (A > C) {
		    	s += 'C';
				solve(A-1, B, C+1, p+1);
				s.pop_back();
				s += 'A';
		    	solve(A+1, B, C-1, p+1);
		    	s.pop_back();
				
		    } else {
		    	s += 'A';
		    	solve(A+1, B, C-1, p+1);
		    	s.pop_back();
				
				s += 'C';
		    	solve(A-1, B, C+1, p+1);
		    	s.pop_back();
				
		    }
		}
	}

	if (t[p] == "BC") {
		if (cnt[p][1] <= B) {
			s += 'C';
			solve(A, B-1, C+1, p+1);
			s.pop_back();
				
		} else if (cnt[p][2] <= C) {
			s += 'B';
			solve(A, B+1, C-1, p+1);
			s.pop_back();
				
		} else {
		    if (B > C) {
		    	s += 'C';
				solve(A, B-1, C+1, p+1);
				s.pop_back();
				
				s += 'B';
		    	solve(A, B+1, C-1, p+1);
		    	s.pop_back();
				
		    } else {
		    	s += 'B';
		    	solve(A, B+1, C-1, p+1);
		    	s.pop_back();
				
				s += 'C';
		    	solve(A, B-1, C+1, p+1);
		    	s.pop_back();
				
		    }
		}
	}
}

int main () {
	SpeedForce;
	cin >> n;

	int A, B, C;
	cin >> A >> B >> C;

	For (i, 1, n) {
		cin >> s;
		t[i] = s;
		for (auto it : s) cnt[i][it-'A']++;
	}

	FOr(i, n, 1) {
		for (int j = 0; j < 3; ++j)
			cnt[i][j] += cnt[i+1][j];
	}

	s = "";
	solve(A, B, C);

	cout << "No\n";

	return Accepted;
}

// B...a

Measured memory_bytes: 71104