#include <bits/stdc++.h>

using namespace std;
using ll = long long int;
constexpr ll M = 1e9 + 7;
inline ll sum_1(const ll n) { return ((n * (n + 1)) / 2) % M; }
inline ll sum_2(const ll n) { return ((n * (n + 1) * (2 * n + 1)) / 6) % M; }
inline ll sum_3(const ll n) { return (((n * (n + 1)) / 2) % M * ((n * (n + 1)) / 2) % M) % M; }
inline ll sum_1(const ll i, const ll j) { return (sum_1(j) - sum_1(i - 1) + M) % M; }
inline ll sum_2(const ll i, const ll j) { return (sum_2(j) - sum_2(i - 1) + M) % M; }
inline ll sum_3(const ll i, const ll j) { return (sum_3(j) - sum_3(i - 1) + M) % M; }

ll pow_f(ll b, ll e) {
    ll ans = 1;
    b = b % M;
    while (e) {
        if (e & 1) {
            ans = (ans * b) % M;
        }
        b = (b * b) % M;
        e >>= 1;
    }
    return ans;
}

ll nCr(ll n, ll r) {
    if (r > n || n < 0 || r < 0) {
        return 0;
    }
    if (n == r || r == 0) {
        return 1;
    }
    r = min(r, n - r);
    ll ans = 1;
    for (ll i = 1; i <= r; ++i) {
        ans = (ans * (n - i + 1)) / (i);
    }
    return ans;
}

ll nCr(tuple<ll, ll> t) {
    auto n = get<0>(t);
    auto k = get<1>(t);
    return nCr(n + k - 1, k);
}

template <typename T>
void print(T v) {
    cout << v << " ";
}

template <typename T>
void print(vector<T> v) {
    for (auto &i : v) {
        print(i);
    }
    cout << endl;
}

ll haschar(string &s, char x) {
    if (s.find(x) != s.npos) {
        return 1;
    }
    return 0;
}

inline char common(string &s, string &s1) {
    for (char i = 'A'; i <= 'C'; ++i) {
        if (s.find(i) != s.npos && s1.find(i) != s.npos) {
            return i;
        }
    }
}

inline char other(string &s, char c) {
    return s[0] ^ s[1] ^ c;
}

void solve() {
    ll n, a, b, c;
    cin >> n >> a >> b >> c;

    vector<string> s(n);
    for (auto &i : s) {
        cin >> i;
    }
    map<char, ll> m = {{'A', a}, {'B', b}, {'C', c}};

    /**
     * +1 to smaller one
     * 
     * 1 1 case 1 1 -> 0 2 -> 1 1 
     * or 1 1 -> 2 0 -> 1 1
     * 
     * If left at 1, 1 OK
     * But if left at 0, 2 or 2, 0 decide... if anyone is used, make sure its non zero
     */
    vector<char> op(n, 'Z');
    bool isPossible = true;

    for (int i = 0; i < n; ++i) {
        if (m[s[i][0]] > m[s[i][1]]) {
            m[s[i][1]]++;
            m[s[i][0]]--;
            op[i] = s[i][1];
        } else if (m[s[i][0]] < m[s[i][1]]) {
            m[s[i][1]]--;
            m[s[i][0]]++;
            op[i] = s[i][0];
        } else {
            //Find next use
            int j = i + 1;
            if (j < n && s[j] != s[i]) {
                char com = common(s[i], s[j]);
                char ot = other(s[i], com);
                m[com]++;
                m[ot]--;
                op[i] = com;
            } else {
                m[s[i][1]]++;
                m[s[i][0]]--;
                op[i] = s[i][1];
            }
        }

        for (auto &j : m) {
            if (j.second < 0) {
                isPossible = false;
                break;
            }
        }
    }

    if (isPossible) {
        cout << "Yes" << endl;
        for (auto &i : op) {
            cout << i << "\n";
        }
    } else {
        cout << "No" << endl;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#ifdef D_LOCAL
    freopen("in.in", "r", stdin);
    freopen("out.out", "w", stdout);
#endif

    solve();

    return 0;
}

Measured memory_bytes: 6680