#import <bits/stdc++.h>
using namespace std;typedef long long ll;
#define rp(i,n) for(ll i=0;i<n;++i)
int main(){ll n;cin>>n;vector<ll> v(99);for(char c='A';c<='C';++c)cin>>v[c];vector<string> s(n);rp(i,n)cin>>s[i];vector<char>a(n);rp(i,n){char x=s[i][0],y=s[i][1],M=(v[x]>=v[y]?x:y),m=x^y^M;if(v[x]==v[y]&&i+1<n&&(s[i+1][0]==x||s[i+1][1]==x))swap(M,m);if(v[M]==0){puts("No");return 0;}v[M]--,v[m]++;a[i]=m;}puts("Yes");rp(i,n)cout<<a[i]<<endl;}