#include<bits/stdc++.h>
using namespace std;

int main(){
  long long n,a,b,c,i;
  cin >> n >> a >> b >> c;
  vector<string> s(n);
  for(i=0;i<n;i++){
    cin >> s.at(i);
  }
  
  if((s.at(0)=="AB"&&a==0&&b==0)||(s.at(0)=="BC"&&b==0&&c==0)||(s.at(0)=="AC"&&a==0&&c==0)){
    cout << "No" << endl;
    return 0;
  }
  
  if(a+b+c>=3){
    cout << "Yes" << endl;
    for(i=0;i<n;i++){
      if(s.at(i)=="AB"){
        if(a>b){
          cout << "B" << endl;
          a--;
          b++;
        }else{
          cout << "A" << endl;
          a++;
          b--;
        }
      }
      if(s.at(i)=="AC"){
        if(a>c){
          cout << "C" << endl;
          a--;
          c++;
        }else{
          cout << "A" << endl;
          a++;
          c--;
        }
      }
      if(s.at(i)=="BC"){
        if(b>c){
          cout << "C" << endl;
          b--;
          c++;
        }else{
          cout << "B" << endl;
          b++;
          c--;
        }
      }
    }
    return 0;
  }
  
  if(a+b+c==1){
    string choice="";
    for(i=0;i<n;i++){
      if(s.at(i)=="AB"){
        if(a+b==0){
          cout << "No" << endl;
          return 0;
        }else if(a==1){
          choice += 'B';
          a=0;
          b=1;
        }else{
          choice += 'A';
          a=1;
          b=0;
        }
      }
      if(s.at(i)=="AC"){
        if(a+c==0){
          cout << "No" << endl;
          return 0;
        }else if(a==1){
          choice += 'C';
          a=0;
          c=1;
        }else{
          choice += 'A';
          a=1;
          c=0;
        }
      }
      if(s.at(i)=="BC"){
        if(b+c==0){
          cout << "No" << endl;
          return 0;
        }else if(b==1){
          choice += 'C';
          b=0;
          c=1;
        }else{
          choice += 'B';
          b=1;
          c=0;
        }
      }
    }
    cout << "Yes" << endl;
    for(i=0;i<n;i++){
      cout << choice.at(i) << endl;
    }
    return 0;
  }
  
  if(a+b+c==2){
    cout << "Yes" << endl;
    for(i=0;i<n;i++){
      if(s.at(i)=="AB"){
        if(a*b==0){
          if(a==0){
            cout << "A" << endl;
            a=1;
            b--;
          }else{
            cout << "B" << endl;
            a--;
            b=1;
          }
        }else{
          if(i==n-1){
            cout << "A" << endl;
          }else if(s.at(i+1)=="AC"){
            cout << "A" << endl;
            a++;
            b--;
          }else{
            cout << "B" << endl;
            a--;
            b++;
          }
        }
      }
      if(s.at(i)=="AC"){
        if(a*c==0){
          if(a==0){
            cout << "A" << endl;
            a=1;
            c--;
          }else{
            cout << "C" << endl;
            a--;
            c=1;
          }
        }else{
          if(i==n-1){
            cout << "A" << endl;
          }else if(s.at(i+1)=="AB"){
            cout << "A" << endl;
            a++;
            c--;
          }else{
            cout << "C" << endl;
            a--;
            c++;
          }
        }
      }
      if(s.at(i)=="BC"){
        if(b*c==0){
          if(b==0){
            cout << "B" << endl;
            b=1;
            c--;
          }else{
            cout << "C" << endl;
            b--;
            c=1;
          }
        }else{
          if(i==n-1){
            cout << "B" << endl;
          }else if(s.at(i+1)=="AB"){
            cout << "B" << endl;
            b++;
            c--;
          }else{
            cout << "C" << endl;
            b--;
            c++;
          }
        }
      }
    }
  }
}

Measured memory_bytes: 6612