#include <iostream>
#include <vector>

using namespace std;
using ll = long long;
using ld = long double;

const string YES = "Yes";
const string NO = "No";

enum { AA = 0, BB = 1, CC = 2,
       BC = 0, AC = -1, AB = -2 };
const char *const pchar = "ABC";

void step(ll &inc, ll &dec, int increased, vector<int> &d) {
  ++inc;
  --dec;
  d.push_back(increased);
}

void solve(ll N, ll A, ll B, ll C, vector<int> s) {
  bool pred = true;
  vector<int> d;
  const auto T = A + B + C;
  if (!T) {
    pred = false;
  } else if (T == 1) {
    for (auto i = 0; i != N; ++i) {
      if(A) {
        switch (s[i]) {
          case AB:
            step(B,A,BB,d);
            break;
          case AC:
            step(C,A,CC,d);
            break;
          case BC:
            pred = false;
            break;
        }
      } else if (B) {
        switch (s[i]) {
          case AB:
            step(A,B,AA,d);
            break;
          case AC:
            pred = false;
            break;
          case BC:
            step(C,B,CC,d);
            break;
        }
      } else {
        switch (s[i]) {
          case AB:
            pred = false;
            break;
          case AC:
            step(A,C,AA,d);
            break;
          case BC:
            step(B,C,BB,d);
            break;
        }
      }
      if (!pred) break;
    }
  } else {
    if ((s[0] == AB && !A && !B) ||
        (s[0] == AC && !A && !C) ||
        (s[0] == BC && !B && !C)) {
      pred = false;
    } else {
      for (auto i = 0; i != N; ++i) {
        switch(s[i]) {
          case AB:
            if (A == 1 && B == 1 && i != N-1 && s[i] != s[i+1]) {
              if (s[i+1] == AC) {
                step(A,B,AA,d);
              } else { // BC
                step(B,A,BB,d);
              }
            } else if (A < B) {
              step(A,B,AA,d);
            } else {
              step(B,A,BB,d);
            }
            break;
          case AC:
            if (A == 1 && C == 1 && i != N-1 && s[i] != s[i+1]) {
              if (s[i+1] == AB) {
                step(A,C,AA,d);
              } else { // BC
                step(C,A,CC,d);
              }
            } else if (A < C) {
              step(A,C,AA,d);
            } else {
              step(C,A,CC,d);
            }
            break;
          case BC:
            if (B == 1 && C == 1 && i != N-1 && s[i] != s[i+1]) {
              if (s[i+1] == AB) {
                step(B,C,BB,d);
              } else { // AC
                step(C,B,CC,d);
              }
            } else if (B < C) {
              step(B,C,BB,d);
            } else {
              step(C,B,CC,d);
            }
            break;
        }
      }
    }
  }
  cout << (pred ? YES : NO) << endl;
  if (!pred) {
    return;
  }
  for (auto i = 0; i != N; ++i) {
    cout << pchar[d[i]] << endl;
  }
}

int main() {
  ll N;
  cin >> N;
  ll A;
  cin >> A;
  ll B;
  cin >> B;
  ll C;
  cin >> C;
  string str;
  vector<int> s(N);
  for (int i = 0; i < N; i++) {
    cin >> str;
    if (str == "AB") {
      s[i] = AB;
    } else if (str == "BC") {
      s[i] = BC;
    } else {
      s[i] = AC;
    }
  }
  solve(N, A, B, C, move(s));
  return 0;
}


Measured memory_bytes: 4332