#include <bits/stdc++.h>
using namespace std;
long long int s2[100000];
int main(){
  long long int n;
  long long int a, b, c;
  string s[100000];
  cin >> n >> a >> b >> c;
  for(int i = 0;i < n;i++){
    cin >> s[i];
  }
  if((a + b + c) >= 3){
    for(int i = 0;i < n;i++){
      if(s[i] == "AB"){
        if(a == 0 && b == 0){
          cout << "No" << endl;
          return 0;
        }
        if(a <= b){
          b--;
          a++;
          s2[i] = 0;
        }else{
          b++;
          a--;
          s2[i] = 1;
        }
      }else if(s[i] == "AC"){
        if(a == 0 && c == 0){
          cout << "No" << endl;
          return 0;
        }
        if(a <= c){
          c--;
          a++;
          s2[i] = 0;
        }else{
          c++;
          a--;
          s2[i] = 2;
        }
      }else{
        if(c == 0 && b == 0){
          cout << "No" << endl;
          return 0;
        }
        if(b <= c){
          b++;
          c--;
          s2[i] = 1;
        }else{
          b--;
          c++;
          s2[i] = 2;
        }
      }
    }
    cout << "Yes" << endl;
    for(int i = 0;i < n;i++){
      if(s2[i] == 0){
        cout << "A" << endl;
      }else if(s2[i] == 1){
        cout << "B" << endl;
      }else{
        cout << "C" << endl;
      }
    }
  }else if((a + b + c) == 2){
    for(int i = 0;i < n;i++){
      if(a == 2){
        if(s[i] == "AB"){
          s2[i] = 1;
          a--;
          b++;
        }else if(s[i] == "AC"){
          s2[i] = 2;
          a--;
          c++;
        }else{
          cout << "No" << endl;
          return 0;
        }
      }else if(b == 2){
        if(s[i] == "AB"){
          s2[i] = 0;
          a++;
          b--;
        }else if(s[i] == "BC"){
          s2[i] = 2;
          b--;
          c++;
        }else{
          cout << "No" << endl;
          return 0;
        }      
      }else if(c == 2){
        if(s[i] == "AC"){
          s2[i] = 0;
          c--;
          a++;
        }else if(s[i] == "BC"){
          s2[i] = 1;
          b++;
          c--;
        }else{
          cout << "No" << endl;
          return 0;
        }
      }else if(c == 0){
        if(s[i] == "AC"){
          a--;
          c++;
          s2[i] = 2;
        }else if(s[i] == "BC"){
          b--;
          c++;
          s2[i] = 2;
        }else{
          if(i == (n - 1)){
            a++;
            b--;
            s2[i] = 0;
          }else if(s[i + 1] == "BC"){
            b++;
            a--;
            s2[i] = 1;
          }else{
            b--;
            a++;
            s2[i] = 0;
          }
        }
      }else if(b == 0){
        if(s[i] == "AB"){
          a--;
          b++;
          s2[i] = 1;
        }else if(s[i] == "BC"){
          b++;
          c--;
          s2[i] = 1;
        }else{
          if(i == (n - 1)){
            a++;
            c--;
            s2[i] = 0;
          }else if(s[i + 1] == "BC"){
            c++;
            a--;
            s2[i] = 2;
          }else{
            c--;
            a++;
            s2[i] = 0;
          }
        }
      }else{
        if(s[i] == "AC"){
          c--;
          a++;
          s2[i] = 0;
        }else if(s[i] == "AB"){
          b--;
          a++;
          s2[i] = 0;
        }else{
          if(i == (n - 1)){
            c++;
            b--;
            s2[i] = 2;
          }else if(s[i + 1] == "AB"){
            b++;
            c--;
            s2[i] = 1;
          }else{
            b--;
            c++;
            s2[i] = 2;
          }
        }
      }
    }
    cout << "Yes" << endl;
    for(int i = 0;i < n;i++){
      if(s2[i] == 0){
        cout << "A" << endl;
      }else if(s2[i] == 1){
        cout << "B" << endl;
      }else{
        cout << "C" << endl;
      }
    }
  }else if((a + b + c) == 1){
    for(int i = 0;i < n;i++){
    if(s[i] == "AB"){
      if(c == 1){
        cout << "No" << endl;
        return 0;
      }else if(a == 1){
        a--;
        b++;
        s2[i] = 1;
      }else{
        a++;
        b--;
        s2[i] = 0;
      }
    }else if(s[i] == "BC"){
      if(a == 1){
        cout << "No" << endl;
        return 0;
      }else if(c == 1){
        c--;
        b++;
        s2[i] = 1;
      }else{
        c++;
        b--;
        s2[i] = 2;
      }
    }else{
      if(b == 1){
        cout << "No" << endl;
        return 0;
      }else if(a == 1){
        a--;
        c++;
        s2[i] = 2;
      }else{
        a++;
        c--;
        s2[i] = 0;
      }
    }
  }
    cout << "Yes" << endl;
    for(int i = 0;i < n;i++){
      if(s2[i] == 0){
        cout << "A" << endl;
      }else if(s2[i] == 1){
        cout << "B" << endl;
      }else{
        cout << "C" << endl;
      }
    }
  }else{
    cout << "No" << endl;
  }
}


Measured memory_bytes: 7492