#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007


int main(){
  
  int n,a,b,c;
  cin >> n >> a >> b >> c;
  vector<char> res(n);
  vector<string> q(n);
  rep(i,n)cin >> q[i];
  if(a > 0 && b > 0 && c > 0){
    rep(i,n){
      if(q[i] == "AB"){
        if(a < b)res[i] = 'A',a++,b--;
        else res[i] = 'B',a--,b++;
      }
      if(q[i] == "AC"){
        if(a <  c)res[i] = 'A',a++,c--;
        else res[i] = 'C',a--,c++;
      }
      if(q[i] == "BC"){
        if(b < c)res[i] = 'B',b++,c--;
        else res[i] = 'C',b--,c++;
      }
    }
  }else if((a > 0)+(b > 0)+(c > 0) >= 2){
    if(a+b+c >= 3){
      rep(i,n){
        if(q[i] == "AB"){
          if(a < b)res[i] = 'A',a++,b--;
          else res[i] = 'B',a--,b++;
        }
        if(q[i] == "AC"){
          if(a <  c)res[i] = 'A',a++,c--;
          else res[i] = 'C',a--,c++;
        }
        if(q[i] == "BC"){
          if(b < c)res[i] = 'B',b++,c--;
          else res[i] = 'C',b--,c++;
        }
      }
    }else{
      rep(i,n){
        if(q[i] == "AB"){
          if(a == b){
            if(i+1 < n){
              if(q[i+1] == "AB")res[i] = 'A',a++,b--;
              else if(q[i+1] == "AC")res[i] = 'A',a++,b--;
              else res[i] = 'B',a--,b++;
              continue;
            }
          }
          if(a < b)res[i] = 'A',a++,b--;
          else res[i] = 'B',a--,b++;
        }
        if(q[i] == "AC"){
          if(a == c){
            if(i+1 < n){
              if(q[i+1] == "AB")res[i] = 'A',a++,c--;
              else if(q[i+1] == "AC")res[i] = 'A',a++,c--;
              else res[i] = 'C',a--,c++;
              continue;
            }
          }
          if(a <  c)res[i] = 'A',a++,c--;
          else res[i] = 'C',a--,c++;
        }
        if(q[i] == "BC"){
          if(b == c){
            if(i+1 < n){
              if(q[i+1] == "AB")res[i] = 'B',b++,c--;
              else if(q[i+1] == "AC")res[i] = 'C',b--,c++;
              else res[i] = 'B',b++,c--;
              continue;
            }
          }
          if(b < c)res[i] = 'B',b++,c--;
          else res[i] = 'C',b--,c++;
        }
      }
    }
  }else{
    rep(i,n){
      if(q[i] == "AB"){
        if(a == b && a == 0){
          cout << "No" << endl;
          return 0;
        }
        if(a == b){
          if(i+1 < n){
            if(q[i+1] == "AB")res[i] = 'A',a++,b--;
            else if(q[i+1] == "AC")res[i] = 'A',a++,b--;
            else res[i] = 'B',a--,b++;
            continue;
          }
        }
        if(a < b)res[i] = 'A',a++,b--;
        else res[i] = 'B',a--,b++;
      }
      if(q[i] == "AC"){
        if(a == c && a == 0){
          cout << "No" << endl;
          return 0;
        }
        if(a == c){
          if(i+1 < n){
            if(q[i+1] == "AB")res[i] = 'A',a++,c--;
            else if(q[i+1] == "AC")res[i] = 'A',a++,c--;
            else res[i] = 'C',a--,c++;
            continue;
          }
        }
        if(a <  c)res[i] = 'A',a++,c--;
        else res[i] = 'C',a--,c++;
      }
      if(q[i] == "BC"){
        if(b == c && b == 0){
          cout << "No" << endl;
          return 0;
        }
        if(b == c){
          if(i+1 < n){
            if(q[i+1] == "AB")res[i] = 'B',b++,c--;
            else if(q[i+1] == "AC")res[i] = 'C',b--,c++;
            else res[i] = 'B',b++,c--;
            continue;
          }
        }
        if(b < c)res[i] = 'B',b++,c--;
        else res[i] = 'C',b--,c++;
      }
    }
  }
  cout << "Yes" << endl;
  rep(i,n)cout << res[i] << endl;


  return 0;
}

Measured memory_bytes: 6408