#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
#define debug(a) cout << #a ": " << a << endl
using namespace std;
typedef long long ll;
const int N = 1e5 + 7;
int cnt[4], n, d[N], path[N], bac[N][4];
bool solve(int a, int b, int c){
    cnt[1] = a, cnt[2] = b, cnt[3] = c;
    for (int i = 1; i <= n; ++i){
        if (d[i] == 1){
            if (!cnt[2] && !cnt[3]) return false;
            else if (!cnt[2]){
                path[i] = 2;
                cnt[2]++, cnt[3]--;
            }else if (!cnt[3]){
                path[i] = 3;
                cnt[2]--, cnt[3]++;
            }else{
                int op = rand()%2+2;
                path[i] = op;
                cnt[op]++, cnt[5-op]--;
            }
        }else if (d[i] == 2){
            if (!cnt[1] && !cnt[3]) return false;
            else if (!cnt[1]){
                path[i] = 1;
                cnt[1]++, cnt[3]--;
            }else if (!cnt[3]){
                path[i] = 3;
                cnt[1]--, cnt[3]++;
            }else{
                int op = rand()%2;
                if (op == 0){
                    path[i] = 1;
                    cnt[1]++, cnt[3]--;
                }else{
                    path[i] = 3;
                    cnt[1]--, cnt[3]++;
                }
            }
        }else{
            if (!cnt[1] && !cnt[2]) return false;
            else if (!cnt[1]){
                path[i] = 1;
                cnt[1]++, cnt[2]--;
            }else if (!cnt[2]){
                path[i] = 2;
                cnt[1]--, cnt[2]++;
            }else{
                int op = rand()%2+1;
                path[i] = op;
                cnt[op]++, cnt[3-op]--;
            }
        }
    }
    return true;
}
bool tanxin(int a, int b, int c){
    cnt[1] = a, cnt[2] = b, cnt[3] = c;
    for (int i = 1; i <= n; ++i){
        if (d[i] == 1){
            if (!cnt[2] && !cnt[3]) return false;
            else if (!cnt[2]){
                path[i] = 2;
                cnt[2]++, cnt[3]--;
            }else if (!cnt[3]){
                path[i] = 3;
                cnt[2]--, cnt[3]++;
            }else{
                if (cnt[2] == 1 && cnt[3] == 1 && cnt[1] == 0){
                    if (i != n && d[i+1] == 2) path[i] = 3, cnt[3]++, cnt[2]--;
                    else path[i] = 2, cnt[2]++, cnt[3]--;
                }else if (cnt[2] > cnt[3]) path[i] = 3, cnt[3]++, cnt[2]--;
                else path[i] = 2, cnt[2]++, cnt[3]--;
            }
        }else if (d[i] == 2){
            if (!cnt[1] && !cnt[3]) return false;
            else if (!cnt[1]){
                path[i] = 1;
                cnt[1]++, cnt[3]--;
            }else if (!cnt[3]){
                path[i] = 3;
                cnt[1]--, cnt[3]++;
            }else{
                if (cnt[1] == 1 && cnt[3] == 1 && cnt[2] == 0){
                    if (i != n && d[i+1] == 1) path[i] = 3, cnt[3]++, cnt[1]--;
                    else path[i] = 1, cnt[1]++, cnt[3]--;
                }else if (cnt[1] > cnt[3]) path[i] = 3, cnt[3]++, cnt[1]--;
                else path[i] = 1, cnt[1]++, cnt[3]--;
            }
        }else{
            if (!cnt[1] && !cnt[2]) return false;
            else if (!cnt[1]){
                path[i] = 1;
                cnt[1]++, cnt[2]--;
            }else if (!cnt[2]){
                path[i] = 2;
                cnt[1]--, cnt[2]++;
            }else{
                if (cnt[1] == 1 && cnt[2] == 1 && cnt[3] == 0){
                    if (i != n && d[i+1] == 1) path[i] = 2, cnt[2]++, cnt[1]--;
                    else path[i] = 1, cnt[1]++, cnt[2]--;
                }else if (cnt[1] > cnt[2]) path[i] = 2, cnt[2]++, cnt[1]--;
                else path[i] = 1, cnt[1]++, cnt[2]--;
            }
        }
    }
    return true;
}
bool tanxin2(int a, int b, int c){
    cnt[1] = a, cnt[2] = b, cnt[3] = c;
    for (int i = 1; i <= n; ++i){
        if (d[i] == 1){
            if (!cnt[2] && !cnt[3]) return false;
            else if (!cnt[2]){
                path[i] = 2;
                cnt[2]++, cnt[3]--;
            }else if (!cnt[3]){
                path[i] = 3;
                cnt[2]--, cnt[3]++;
            }else{
                if (bac[i][3] > bac[i][2]) path[i] = 3, cnt[3]++, cnt[2]--;
                else path[i] = 2, cnt[2]++, cnt[3]--;
            }
        }else if (d[i] == 2){
            if (!cnt[1] && !cnt[3]) return false;
            else if (!cnt[1]){
                path[i] = 1;
                cnt[1]++, cnt[3]--;
            }else if (!cnt[3]){
                path[i] = 3;
                cnt[1]--, cnt[3]++;
            }else{
                if (bac[i][3] > bac[i][1]) path[i] = 3, cnt[3]++, cnt[1]--;
                else path[i] = 1, cnt[1]++, cnt[3]--;
            }
        }else{
            if (!cnt[1] && !cnt[2]) return false;
            else if (!cnt[1]){
                path[i] = 1;
                cnt[1]++, cnt[2]--;
            }else if (!cnt[2]){
                path[i] = 2;
                cnt[1]--, cnt[2]++;
            }else{
                if (bac[i][2] > bac[i][1]) path[i] = 2, cnt[2]++, cnt[1]--;
                else path[i] = 1, cnt[1]++, cnt[2]--;
            }
        }
    }
    return true;
}
int main(void){
    srand(time(0));
    IOS;
    int a, b, c;
    cin >> n >> a >> b >> c;
    for (int i = 1; i <= n; ++i){
        string s; cin >> s;
        int x;
        if (s == "AB") x = 3;
        else if (s == "AC") x = 2;
        else x = 1;
        d[i] = x;
    }
    for (int i = n; i >= 1; --i){
        bac[i][1] = bac[i+1][1];
        bac[i][2] = bac[i+1][2];
        bac[i][3] = bac[i+1][3];
        if (d[i] == 1){
            bac[i][2]++, bac[i][3]++;
        }else if (d[i] == 2){
            bac[i][1]++, bac[i][3]++;
        }else{
            bac[i][1]++, bac[i][2]++;
        }
    }
    /*for (int i = 1; i <= 6000; ++i){
        if (solve(a, b, c)){
            cout << "Yes" << endl;
            //printf("%d %d %d\n", cnt[1], cnt[2], cnt[3]);
            for (int j = 1; j <= n; ++j){
                cout << char(path[j]+'A'-1) << endl;
            }
            return 0;
        }
    }*/
    if (tanxin(a, b, c)){
        cout << "Yes" << endl;
        for (int j = 1; j <= n; ++j){
            cout << char(path[j]+'A'-1) << endl;
        }
    }else if (tanxin2(a, b, c)){
        cout << "Yes" << endl;
        for (int j = 1; j <= n; ++j){
            cout << char(path[j]+'A'-1) << endl;
        }
    }else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 6008