#define MOD_TYPE 1

#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
/*
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
using multiInt = boost::multiprecision::cpp_int;
using lld = boost::multiprecision::cpp_dec_float_100;
*/
/*
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
*/
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

constexpr ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
constexpr int INF = (int)1e9;
constexpr ll LINF = (ll)4e18;
constexpr ld PI = acos(-1.0);
constexpr ld EPS = 1e-11;
constexpr int Dx[] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
constexpr int Dy[] = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define REPI(i, m, n) for (int i = m; i < (int)(n); ++i)
#define repi(i, n) REPI(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << "\n"
#define Yes(n) cout << ((n) ? "Yes" : "No") << "\n"
#define possible(n) cout << ((n) ? "possible" : "impossible") << "\n"
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << "\n"
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << "\n"
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << "\n";

inline void init_main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(30) << setiosflags(ios::fixed);
}
template <typename T>
inline bool chmin(T &a, T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmax(T &a, T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
inline ll CEIL(ll a, ll b)
{
  return (a + b - 1) / b;
}
template <typename A, size_t N, typename T>
inline void Fill(A (&array)[N], const T &val)
{
  fill((T *)array, (T *)(array + N), val);
}
#pragma endregion

int main()
{
  init_main();

  int n;
  cin >> n;
  ll a[3];
  rep(i, 3) cin >> a[i];
  vector<string> s(n);
  rep(i, n) cin >> s[i];
  int sorted[3];
  rep(i, 3) sorted[i] = a[i];
  sort(sorted, sorted + 3);
  vector<char> ans;
  vector<int> index[100010];
  rep(i, n)
  {
    for (auto c : s[i])
      index[i].push_back(c - 'A');
  }
  int i = 0;
  if (sorted[0] == 0 && sorted[1] == 0 && sorted[2] == 0)
  {
    Yes(0);
    return 0;
  }
  else if (sorted[0] == 0 && sorted[1] == 0 && sorted[2] == 1)
  {
    //貪欲
    rep(ii, n)
    {
      if (a[index[ii][0]] == 0 && a[index[ii][1]] == 0)
      {
        Yes(0);
        return 0;
      }
      if (a[index[ii][0]] == 0)
      {
        ans.push_back(index[ii][0] + 'A');
        a[index[ii][0]]++;
        a[index[ii][1]]--;
      }
      else
      {
        ans.push_back(index[ii][1] + 'A');
        a[index[ii][1]]++;
        a[index[ii][0]]--;
      }
    }
    Yes(1);
    rep(ii, n) cout << ans[ii] << "\n";
    return 0;
  }
  else if (sorted[0] == 0 && sorted[1] == 0 && sorted[2] >= 2)
  {
    if (a[index[0][0]] == 0 && a[index[0][1]] == 0)
    {
      Yes(0);
      return 0;
    }
    if (a[index[0][0]] == 0)
    {
      a[index[0][0]]++;
      a[index[0][1]]--;
      ans.push_back(index[0][0] + 'A');
      i = 1;
    }
    else
    {
      a[index[0][1]]++;
      a[index[0][0]]--;
      ans.push_back(index[0][1] + 'A');
      i = 1;
    }
  }
  Yes(1);

  while (i < n)
  {
    //dbg(i);
    //cerr << a[0] << " " << a[1] << " " << a[2] << "\n";
    if (a[index[i][0]] >= 1 && a[index[i][1]] >= 1) // 1 1
    {
      if (i == n - 1)
      {
        ans.push_back(index[i][0] + 'A');
        break;
      }
      rep(j, 3)
      {
        if (count(all(index[i]), j) && count(all(index[i + 1]), j))
        {
          for (auto t : index[i])
          {
            if (t == j)
              a[t]++;
            else
              a[t]--;
          }
          ans.push_back(j + 'A');
          if (index[i + 1][0] != j)
          {
            a[index[i + 1][0]]++;
            a[index[i + 1][1]]--;
            ans.push_back(index[i + 1][0] + 'A');
          }
          else
          {
            a[index[i + 1][1]]++;
            a[index[i + 1][0]]--;
            ans.push_back(index[i + 1][1] + 'A');
          }

          i += 2;
          break;
        }
      }
    }
    else // 1 0
    {
      if (a[index[i][0]] == 0)
      {
        a[index[i][0]]++;
        a[index[i][1]]--;
        ans.push_back(index[i][0] + 'A');
        i++;
      }
      else
      {
        a[index[i][1]]++;
        a[index[i][0]]--;
        ans.push_back(index[i][1] + 'A');
        i++;
      }
    }
  }

  rep(i, n) cout << ans[i] << "\n";

  return 0;
}


Measured memory_bytes: 12240