#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main(){
    ll n,a,b,c; cin >> n >> a >> b >> c;
    vector<string> data(n); rep(i,n) cin >> data[i];

    if(a+b+c == 0) { cout << "No" << endl; return 0;}

    bool ans = true;
    vector<string> data2(n);

    if(a+b+c == 1){
        rep(i,n){
            string s = data[i];
            if(s == "AB"){
                if(a == 1) { a--; b++; data2[i] = "B"; }
                else if(b == 1) { b--; a++; data2[i] = "A"; }
                else if(c == 1) { ans = false; break; }
            }
            else if(s == "AC"){
                if(a == 1) { a--; c++; data2[i] = "C"; }
                else if(c == 1) { c--; a++; data2[i] = "A"; }
                else if(b == 1) { ans = false; break; }
            }
            else if(s == "BC"){
                if(b == 1) { b--; c++; data2[i] = "C"; }
                else if(c == 1) { c--; b++; data2[i] = "B"; }
                else if(c == 1) { ans = false; break; }
            }
            if(!ans) break;
        }
    }

    if(a+b+c > 1){
        rep(i,n){
            string s = data[i];
            if(s == "AB"){
                if(a == 0 && b == 0) { ans = false; break; }
                else if(a >= 1 && b == 0) { a--; b++; data2[i] = "B"; }
                else if(a == 0 && b >= 1) { b--; a++; data2[i] = "A"; }
                else if(a == 1 || b == 1){
                    if(i == n-1) { a--; b++; data2[i] = "B"; }
                    else{
                        if(data[i+1] == "AB") { a--; b++; data2[i] = "B"; }
                        else if(data[i+1] == "BC") { a--; b++; data2[i] = "B"; }
                        else if(data[i+1] == "AC") { a++; b--; data2[i] = "A"; }
                    }
                }
                else{ a--; b++; data2[i] = "B"; }
            }
            if(s == "AC"){
                if(a == 0 && c == 0) { ans = false; break; }
                else if(a >= 1 && c == 0) { a--; c++; data2[i] = "C"; }
                else if(a == 0 && c >= 1) { c--; a++; data2[i] = "A"; }
                else if(a == 1 || c == 1){
                    if(i == n-1) { a--; c++; data2[i] = "C"; }
                    else{
                        if(data[i+1] == "AC") { a--; c++; data2[i] = "C"; }
                        else if(data[i+1] == "BC") { a--; c++; data2[i] = "C"; }
                        else if(data[i+1] == "AB") { a++; c--; data2[i] = "A"; }
                    }
                }
                else{ a--; c++; data2[i] = "C"; }
            }
            if(s == "BC"){
                if(c == 0 && b == 0) { ans = false; break; }
                else if(c >= 1 && b == 0) { c--; b++; data2[i] = "B"; }
                else if(c == 0 && b >= 1) { b--; c++; data2[i] = "C"; }
                else if(c == 1 || b == 1){
                    if(i == n-1) { c--; b++; data2[i] = "B"; }
                    else{
                        if(data[i+1] == "AB") { c--; b++; data2[i] = "B"; }
                        else if(data[i+1] == "BC") { c--; b++; data2[i] = "B"; }
                        else if(data[i+1] == "AC") { c++; b--; data2[i] = "C"; }
                    }
                }
                else{ c--; b++; data2[i] = "B"; }
            }
            if(!ans) break;
        }
    }
    if(ans){
        cout << "Yes" << endl;
        rep(i,n) cout << data2[i] << endl;
    }
    else cout << "No" << endl;
}

Measured memory_bytes: 9564