#include <bits/stdc++.h>
using namespace std;
void solve(int A, int B, int C, vector<string> s){
  int N = s.size();
  s.push_back("AC");
  for (int i = 0; i < N; i++){
    int st = 0;
    if (A == 0 && B >= 1 && C >= 1) st = 0;
    if (A >= 1 && B >= 0 && C >= 1) st = 1;
    if (A >= 1 && B >= 1 && C == 0) st = 2;
    if (A >= 2 && B == 0 && C == 0) st = 3;
    if (A == 0 && B >= 2 && C == 0) st = 4;
    if (A == 0 && B == 0 && C >= 2) st = 5;
    if (st == 3){
      if (s[i] == "AB"){
        cout << 'B' << endl;
        A--;
        B++;
      } else {
        cout << 'C' << endl;
        A--;
        C++;
      }
    }
    if (st == 4){
      if (s[i] == "AB"){
        cout << 'A' << endl;
        A++;
        B--;
      } else {
        cout << 'C' << endl;
        B--;
        C++;
      }
    }
    if (st == 5){
      if (s[i] == "BC"){
        cout << 'B' << endl;
        B++;
        C--;
      } else {
        cout << 'A' << endl;
        A++;
        C--;
      }
    }
    if (st == 0){
      if (s[i] == "AB"){
        cout << 'A' << endl;
        A++;
        B--;
      } else if (s[i] == "AC"){
        cout << 'A' << endl;
        A++;
        C--;
      } else if (s[i + 1] == "AB"){
        cout << 'B' << endl;
        B++;
        C--;
      } else {
        cout << 'C' << endl;
        C++;
        B--;
      }
    }
    if (st == 1){
      if (s[i] == "AB"){
        cout << 'B' << endl;
        B++;
        A--;
      } else if (s[i] == "BC"){
        cout << 'B' << endl;
        B++;
        C--;
      } else if (s[i + 1] == "AB"){
        cout << 'A' << endl;
        A++;
        C--;
      } else {
        cout << 'C' << endl;
        C++;
        A--;
      }
    }
    if (st == 2){
      if (s[i] == "AC"){
        cout << 'C' << endl;
        C++;
        A--;
      } else if (s[i] == "BC"){
        cout << 'C' << endl;
        C++;
        B--;
      } else if (s[i + 1] == "AC"){
        cout << 'A' << endl;
        A++;
        B--;
      } else {
        cout << 'B' << endl;
        B++;
        A--;
      }
    }
  }
  return;
}  
int main(){
  int N, A, B, C;
  cin >> N >> A >> B >> C;
  vector<string> s(N);
  for (int i = 0; i < N; i++){
    cin >> s[i];
  }
  int zero = 0;
  if (A == 0){
    zero++;
  }
  if (B == 0){
    zero++;
  }
  if (C == 0){
    zero++;
  }
  if (zero <= 1){
    cout << "Yes" << endl;
    solve(A, B, C, s);
  } else if (zero == 3){
    cout << "No" << endl;
  } else if (A + B + C >= 2){
    //200など
    string S = s[0];
    vector<string> s2;
    for (int i = 1; i < N; i++){
      s2.push_back(s[i]);
    }
    if (A != 0 && S == "AB"){
      cout << "Yes" << endl;
      cout << "B" << endl;
      A--;
      B++;
      solve(A, B, C, s2);
    } else if (A != 0 && S == "AC"){
      cout << "Yes" << endl;
      cout << "C" << endl;
      A--;
      B++;
      solve(A, B, C, s2);
    } else if (B != 0 && S == "AB"){
      cout << "Yes" << endl;
      cout << "A" << endl;
      B--;
      A++;
      solve(A, B, C, s2);
    } else if (B != 0 && S == "BC"){
      cout << "Yes" << endl;
      cout << "C" << endl;
      B--;
      C++;
      solve(A, B, C, s2);
    } else if (C != 0 && S == "AC"){
      cout << "Yes" << endl;
      cout << "A" << endl;
      C--;
      A++;
      solve(A, B, C, s2);
    } else if (C != 0 && S == "BC"){
      cout << "Yes" << endl;
      cout << "B" << endl;
      C--;
      B++;
      solve(A, B, C, s2);
    } else {
      cout << "No" << endl;
    }
  } else {
    //100, 010, 001
    vector<char> ans(N);
    bool flg = true;
    for (int i = 0; i < N; i++){
      if (A == 1 && s[i] == "AB"){
        ans[i] = 'B';
        A--;
        B++;
      } else if (A == 1 && s[i] == "AC"){
        ans[i] = 'C';
        A--;
        C++;
      } else if (B == 1 && s[i] == "AB"){
        ans[i] = 'A';
        B--;
        A++;
      } else if (B == 1 && s[i] == "BC"){
        ans[i] = 'C';
        B--;
        C++;
      } else if (C == 1 && s[i] == "AC"){
        ans[i] = 'A';
        C--;
        A++;
      } else if (C == 1 && s[i] == "BC"){
        ans[i] = 'B';
        C--;
        B++;
      } else {
        flg = false;
        break;
      }
    }
    if (flg){
      cout << "Yes" << endl;
      for (int i = 0; i < N; i++){
        cout << ans[i] << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
}

Measured memory_bytes: 15780