#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) for(ll i=0;i<(n);++i)
#define REPR(i,n) for(ll i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int n,a,b,c; cin>>n>>a>>b>>c;
    vector<char> ans(n);
    vector<string> str(n);
    rep(i,n) cin>>str[i];

    if (a+b+c <= 0) {
        cout << "No" << '\n';
        return 0;
    }
    
    rep(i,n) {
        string s = str[i];
        if (s == "AB") {
            if (a == b && a==1 && i+1 < n) {
                string t = str[i+1];
                map<char, int> mp;
                rep(j,2) {
                    mp[s[j]]++; mp[t[j]]++;
                }
                if (mp['A'] >= 2) {
                    a++;
                    b--;
                    ans[i] = 'A';
                }
                else {
                    a--;
                    b++;
                    ans[i] = 'B';
                }
            }
            else if (a >= b) {
                a--; b++; ans[i] = 'B';
            }
            else {
                a++; b--; ans[i] = 'A';
            }
        }
        else if (s == "BC") {
            if (b==c && b==1 && i+1 < n) {
                string t = str[i+1];
                map<char, int> mp;
                rep(j,2) {
                    mp[s[j]]++; mp[t[j]]++;
                }
                if (mp['B'] >= 2) {
                    b++;
                    c--;
                    ans[i] = 'B';
                }
                else {
                    b--;
                    c++;
                    ans[i] = 'C';
                }
            }
            else if (b >= c) {
                b--; c++; ans[i] = 'C';
            }
            else {
                b++; c--; ans[i] = 'B';
            }
        }
        else if (s == "AC") {
            if (a == c && a==1 && i+1 < n) {
                string t = str[i+1];
                map<char, int> mp;
                rep(j,2) {
                    mp[s[j]]++; mp[t[j]]++;
                }
                if (mp['A'] >= 2) {
                    a++;
                    c--;
                    ans[i] = 'A';
                }
                else {
                    a--;
                    c++;
                    ans[i] = 'C';
                }
            }
            else if (a >= c) {
                a--; c++; ans[i] = 'C';
            }
            else {
                a++; c--; ans[i] = 'A';
            }
        }

        if (a<0 || b<0 || c<0) {
            cout << "No" << '\n';
            return 0;
        }
    }

    cout << "Yes" << '\n';
    for (auto &&e: ans) cout << e << '\n';
    return 0;
}

Measured memory_bytes: 6404