#include <bits/stdc++.h>
#define my_max(a, b) ((a) > (b) ? (a) : (b))
#define my_min(a, b) ((a) < (b) ? (a) : (b))
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rep(i, s, t) for(int i = (int)(s); i <= (int)(t); i++)
#define rev(i, t, s) for(int i = (int)(t); i >= (int)(s); i--)
#define lson rt << 1
#define rson rt << 1 | 1
#define sz(x) (int)(x).size()

typedef long long ll;
typedef long double lb;
typedef std::pair<int, int> pii;
typedef std::pair<ll, ll> pll;
typedef std::vector<int> VI;
typedef std::vector<ll> VL;
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> rbtree;
ll gcd(ll x, ll y) {
    return y % x == 0 ? x : gcd(y % x, x);
}
template<class T>T my_abs(T a) {
    if(a < 0)
        a = -a;
    return a;
}
inline ll read() {
    ll ret = 0, sign = 1;
    char c = getchar();
    while(c < '0' || c > '9') {
        if(c == '-')
            sign = -1;
        c = getchar();
    }
    while(c >= '0' && c <= '9') {
        ret = ret * 10 + c - '0';
        c = getchar();
    }
    return ret * sign;
}
inline void write(ll x) {
    if(x < 0) {
        putchar('-');
        x = -x;
    }
    if(x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}

//void expand_stack_space(){
//    int size = 256 << 20; // 256MB
//    char *p = (char*)malloc(size) + size;
//    __asm__("movl %0, %%esp\n" :: "r"(p));
//}
const int maxn = 1e5 + 7;
int n, a, b, c;
char s[10];
string t[maxn];
string ans;
int cnt = 0;
int op[3];
bool dfs(int p, int a, int b, int c) {
    //printf("p %d %d %d %d\n", p, a, b, c);
    if(cnt >= 1e8) return false;
    if(a < 0 || b < 0 || c < 0) return false;
    if(p == n + 1) return true;
    ++cnt;
    int ta = a, tb = b, tc = c;
    int Max = max({a, b, c}), Min = min({a, b, c});
    if(t[p] == "AB") {
        --op[0]; --op[1];
        if(a == Max) {
            ans += "B";
            --a; ++b;
        } else if(b == Max) {
            ans += "A";
            ++a; --b;
        } else if(op[0] == 0 && a > 0 && a == Min) {
            ans += "B";
            --a; ++b;
        } else if(op[1] == 0 && b > 0 && b == Min) {
            ans += "A";
            ++a; --b;
        } else if(a > b) {
            ans += "B";
            --a; ++b;
        } else {
            ans += "A";
            ++a; --b;
        }
    } else if(t[p] == "AC") {
        --op[0]; --op[2];
        if(a == Max) {
            ans += "C";
            --a; ++c;
        } else if(c == Max) {
            ans += "A";
            ++a; --c;
        } else if(op[0] == 0 && a > 0 && a == Min) {
            ans += "C";
            --a; ++c;
        } else if(op[2] == 0 && c > 0 && c == Min) {
            ans += "A";
            ++a; --c;
        } else if(a > c) {
            ans += "C";
            --a; ++c;
        } else {
            ans += "A";
            ++a; --c;
        }
    } else {
        --op[1]; --op[2];
        if(b == Max) {
            ans += "C";
            --b; ++c;
        } else if(c == Max) {
            ans += "B";
            ++b; --c;
        } else if(op[1] == 0 && b > 0 && b == Min) {
            ans += "C";
            --b; ++c;
        } else if(op[2] == 0 && c > 0 && c == Min) {
            ans += "B";
            ++b; --c;
        } else if(b > c) {
            ans += "C";
            --b; ++c;
        } else {
            ans += "B";
            ++b; --c;
        }
    }
    if(dfs(p + 1, a, b, c)) return true;
    ans.pop_back();
    if(t[p] == "AB") {
        if(a < ta) a += 2, b -= 2, ans += "A";
        else a -= 2, b += 2, ans += "B";
    }
    else if(t[p] == "AC") {
        if(a < ta) a += 2, c -= 2, ans += "A";
        else a -= 2, c += 2, ans += "C";

    } else {
        if(b < tb) b += 2, c -= 2, ans += "B";
        else b -= 2, c += 2, ans += "C";
    }
    if(dfs(p + 1, a, b, c)) return true;
    if(t[p] == "AB") {
        ++op[0]; ++op[1];
    }
    else if(t[p] == "AC") {
        ++op[0]; ++op[2];
    } else {
        ++op[1]; ++op[2];
    }
    ans.pop_back();
    return false;
}
int main() {
#ifndef ONLINE_JUDGE
//    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
#endif // ONLINE_JUDGE
    scanf("%d%d%d%d", &n, &a, &b, &c);
    ans = "";
    for(int i = 1; i <= n; ++i) {
        scanf("%s", s);
        t[i] = s;
        if(t[i] == "AB") ++op[0], ++op[1];
        else if(t[i] == "AC") ++op[0], ++op[2];
        else ++op[1], ++op[2];
    }
    if(dfs(1, a, b, c)) {
        puts("Yes");
        for(char c : ans) printf("%c\n", c);
    } else puts("No");
    return 0;
}


Measured memory_bytes: 14896