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

#define pb push_back

#define int ll
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;

template<typename T, typename U>
ostream& operator<<(ostream& o, const pair<T,U>& p) {
  return o << "(" << p.first << "," << p.second << ")";
}

template<typename T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "[";
  for (const T& x : v)
    o << x << ",";
  return o << "]";
}

const int INF = 1e18;

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int n, a, b, c;
  cin >> n >> a >> b >> c;
  set<pii> xa;
  set<pii> xb;
  set<pii> xc;
  bool poss = true;
  for (int i=0; i<n; ++i) {
    string op;
    cin >> op;
    if (!poss)
      continue;
    if (op == "AB") {
      if (a == 0 && b == 0) {
        if (!xc.empty() && c >= 2) {
          auto topit = prev(xc.end());
          pii top = *topit;
          xc.erase(topit);
          c -= 2;
          if (top.second == 0) {
            a += 2;
            xa.insert({top.first, 2});
          } else {
            b += 2;
            xb.insert({top.first, 2});
          }
        } else {
          poss = false;
          continue;
        }
      }
      if (a > 0) {
        --a;
        ++b;
        xb.insert({i, 0});
      } else {
        assert(b > 0);
        ++a;
        --b;
        xa.insert({i, 1});
      }
    } else if (op == "AC") {
      if (a == 0 && c == 0) {
        if (!xb.empty() && b >= 2) {
          auto topit = prev(xb.end());
          pii top = *topit;
          xb.erase(topit);
          b -= 2;
          if (top.second == 0) {
            a += 2;
            xa.insert({top.first, 1});
          } else {
            c += 2;
            xc.insert({top.first, 1});
          }
        } else {
          poss = false;
          continue;
        }
      }
      if (a > 0) {
        --a;
        ++c;
        xc.insert({i, 0});
      } else {
        assert(c > 0);
        ++a;
        --c;
        xa.insert({i, 2});
      }
    } else {
      assert(op == "BC");
      if (b == 0 && c == 0) {
        if (!xa.empty() && a >= 2) {
          auto topit = prev(xa.end());
          pii top = *topit;
          xa.erase(topit);
          a -= 2;
          if (top.second == 1) {
            b += 2;
            xb.insert({top.first, 0});
          } else {
            c += 2;
            xc.insert({top.first, 0});
          }
        } else {
          poss = false;
          continue;
        }
      }
      if (b > 0) {
        --b;
        ++c;
        xc.insert({i, 1});
      } else {
        assert(c > 0);
        ++b;
        --c;
        xb.insert({i, 2});
      }
    }
    assert(a >= 0 && b >= 0 && c >= 0);
  }
  if (!poss) {
    cout << "No\n";
    return 0;
  }
  cout << "Yes\n";
  auto xait = xa.begin();
  auto xbit = xb.begin();
  auto xcit = xc.begin();
  for (int i=0; i<n; ++i) {
    if (xait != xa.end() && xait->first == i) {
      cout << "A\n";
      ++xait;
    } else if (xbit != xb.end() && xbit->first == i) {
      cout << "B\n";
      ++xbit;
    } else {
      assert(xcit != xc.end() && xcit->first == i);
      cout << "C\n";
      ++xcit;
    }
  }
}


Measured memory_bytes: 9888