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

int main() {
    ll N, A, B, C; cin >> N >> A >> B >> C;
    vector<string> S(N); for (int i = 0; i < N; i++) cin >> S[i];
    int a = A, b = B, c = C;
    for (int i = 0; i < N-1; i++) {
        if (S[i] == "AB") {
            if (a == 0 && b == 0) {
                cout << "No" << endl;
                return 0;
            } else if (a == 1 && b == 1) {
                if (S[i+1] == "AC") {
                    a++; b--;
                } else if (S[i+1] == "BC") {
                    a--; b++;
                } else {
                    a++; b--;
                }
            } else if (a > b) {
                a--; b++;
            } else {
                a++; b--;
            }

        }
        if (S[i] == "BC") {
            if (b == 0 && c == 0) {
                cout << "No" << endl;
                return 0;
            }
            if (b == 1 && c == 1) {
                if (S[i+1] == "AB") {
                    b++; c--;
                } else if (S[i+1] == "AC") {
                    b--; c++;
                } else {
                    b++; c--;
                }
            } else if(b > c) {
                b--; c++;
            } else {
                b++; c--;
            }
        }
        if (S[i] == "AC") {
            if (a == 0 && c == 0) {
                cout << "No" << endl;
                return 0;
            }
            if (a == 1 && c == 1) {
                if (S[i+1] == "AB") {
                    a++; c--;
                } else if (S[i+1] == "BC") {
                    a--; c++;
                } else {
                    a++; c--;
                }
            } else if (a > c) {
                a--; c++;
            } else {
                a++; c--;
            }
        }
    }
    if (S[N-1] == "AB") {
            if (a == 0 && b == 0) {
                cout << "No" << endl;
                return 0;
            }
        }
    if (S[N-1] == "BC") {
        if (b == 0 && c == 0) {
            cout << "No" << endl;
            return 0;
        }
    }
    if (S[N-1] == "AC") {
        if (a == 0 && c == 0) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    a = A; b = B; c = C;
    for (int i = 0; i < N-1; i++) {
        if (S[i] == "AB") {
            if (a == 0 && b == 0) {
                cout << "No" << endl;
                return 0;
            } else if (a == 1 && b == 1) {
                if (S[i+1] == "AC") {
                    a++; b--;
                    cout << "A" << endl;
                } else if (S[i+1] == "BC") {
                    a--; b++;
                    cout << "B" << endl;
                } else {
                    a++; b--;
                    cout << "A" << endl;
                }
            } else if (a > b) {
                a--; b++;
                cout << "B" << endl;
            } else {
                a++; b--;
                cout << "A" << endl;
            }
        }
        if (S[i] == "BC") {
            if (b == 0 && c == 0) {
                cout << "No" << endl;
                return 0;
            }
            if (b == 1 && c == 1) {
                if (S[i+1] == "AB") {
                    b++; c--;
                    cout << "B" << endl;
                } else if (S[i+1] == "AC") {
                    b--; c++;
                    cout << "C" << endl;
                } else {
                    b++; c--;
                    cout << "B" << endl;
                }
            } else if(b > c) {
                b--; c++;
                cout << "C" << endl;
            } else {
                b++; c--;
                cout << "B" << endl;
            }
        }
        if (S[i] == "AC") {
            if (a == 0 && c == 0) {
                cout << "No" << endl;
                return 0;
            }
            if (a == 1 && c == 1) {
                if (S[i+1] == "AB") {
                    a++; c--;
                    cout << "A" << endl;
                } else if (S[i+1] == "BC") {
                    a--; c++;
                    cout << "C" << endl;
                } else {
                    a++; c--;
                    cout << "A" << endl;
                }
            } else if (a > c) {
                a--; c++;
                cout << "C" << endl;
            } else {
                a++; c--;
                cout << "A" << endl;
            }
        }
    }

    if (S[N-1] == "AB") {if (a > b) cout << "B" << endl; else cout << "A" << endl;}
    if (S[N-1] == "BC") {if (b > c) cout << "C" << endl; else cout << "B" << endl;}
    if (S[N-1] == "AC") {if (a > c) cout << "C" << endl; else cout << "A" << endl;}
}

Measured memory_bytes: 6424