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

#define int long long
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define fr(i,j,k) for(i = j; i < (k); i++)
#define all(x) x.begin(), x.end()
#define el '\n'
#define remax(a,b) a = max(a, b)
#define remin(a,b) a = min(a, b)
#define sz(x) int32_t(x.size())

typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpi;
// --------------------------------------------------------------------

const pii dxy[] = { {-1, 0}, {1, 0}, {0, 1}, {0, -1} };
const int mod = 1e9 + 7;
const int INF = 2e18;
const ld EPS = 1e-9;
const int NN = 1e5 + 2;

char other(string s) {
      if(s == "AB") return 'C';
      if(s == "AC") return 'B';
      return 'A';
}

vector<string> s(NN);
vector<map<string, int>> nxt(NN);

void solve() {
      int i = 0, j = 0, k = 0, n = 0, m = 0; 
      cin >> n;
      int a, b, c;
      cin >> a >> b >> c;
      map<char, int> val;
      val['A'] = a;
      val['B'] = b;
      val['C'] = c;

      fr(i, 0, n) {
            cin >> s[i];
      }

      for(string S : {"AB", "AC", "BC"}) {
            nxt[n][S] = n+2;
      }

      for(i = n-1; i >= 0; i--) {
            nxt[i] = nxt[i + 1];
            nxt[i][s[i]] = i;
      }

      bool can = 1;
      vi ans;
      fr(i, 0, n) {
            int& v1 = val[s[i][0]];
            int& v2 = val[s[i][1]];
            if(v1 > 1 || v2 > 1) {
                  if(v1 >= v2) {
                        ans.pb(s[i][1]);
                        v1 -= 1;
                        v2 += 1;
                  } else {
                        ans.pb(s[i][0]);
                        v1++; v2--;
                  }
            }
             else if(v1 == 0){
                   if(v2 == 0) {
                         can = 0; break;
                   }

                  ans.pb(s[i][0]);
                  v1++;
                  v2--;
 
            } else if(v2 == 0) {
                  ans.pb(s[i][1]);
                  v1--;
                  v2++;
            } else {
                  // v1 = 1, v2 = 1
                  assert(v1 == 1 and v2 == 1);
                  char ch = other(s[i]);
                  if(val[ch] > 0) {
                        v1--;
                        v2++;
                        ans.pb(s[i][1]);
                  } else {
                        string t1 = string(1, s[i][0]);
                        t1 += ch;
                        sort(all(t1));
                        int p1 = nxt[i + 1][t1];
                        string t2 = string(1, s[i][1]);
                        t2 += ch;
                        sort(all(t2));
                        int p2 = nxt[i + 1][t2];
                        if(p2 > p1) {
                              ans.pb(s[i][0]);
                              v1++;
                              v2--;
                        } else {
                              ans.pb(s[i][1]);
                              v1--;
                              v2++;
                        }
                  }
            }
      }

      if(can) {
            cout << "Yes\n";
            for(char c : ans) cout << c << el;
      }else {
            cout << "No\n";
      }
}

int32_t main() {
      ios::sync_with_stdio(false); cin.tie(0); 
      int T = 1; 
      // cin >> T;
      for(int tc = 1; tc <= T; tc++) {
            solve();
       }
      return 0;
}

Measured memory_bytes: 35548