#include <bits/stdc++.h>

using namespace std;
long long n;
string s[100009];
char ans[100009];
map <char, long long> mp;

bool dfs(long long idx){
  if(idx==n)return true;
  if(mp[s[idx][0]]==0 && mp[s[idx][1]]==0)return false;
  if(mp[s[idx][0]]==mp[s[idx][1]]){
    bool ret;
    mp[s[idx][0]]++;
    mp[s[idx][1]]--;
    if(dfs(idx+1)){
      ans[idx] = s[idx][0];
      return true;
    }
    mp[s[idx][0]]-=2;
    mp[s[idx][1]]+=2;
    if(dfs(idx+1)){
      ans[idx] = s[idx][1];
      return true;
    }
    mp[s[idx][0]]--;
    mp[s[idx][1]]++;
    return false;
  }
  else if(mp[s[idx][0]]>mp[s[idx][1]]){
    mp[s[idx][0]]--;
    mp[s[idx][1]]++;
    ans[idx] = s[idx][1];
    return dfs(idx+1);
  }
  else{
    mp[s[idx][0]]++;
    mp[s[idx][1]]--;
    ans[idx] = s[idx][0];
    return dfs(idx+1);
  }
}

int main(){
  long long a, b ,c;
  cin >> n >> a >> b >> c;
  for(int i=0;i<n;i++)cin >> s[i];
  mp['A'] = a;
  mp['B'] = b;
  mp['C'] = c;
  if(dfs(0)){
    cout << "Yes" << endl;
    for(int i=0;i<n;i++)cout << ans[i] << endl;
  }
  else cout << "No" << endl;
}
