// Problem : F - Three Variables Game
// Contest : AtCoder - AtCoder Beginner Contest 166
// URL : https://atcoder.jp/contests/abc166/tasks/abc166_f
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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


int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    long n, a, b, c;
    cin >> n >> a >> b >> c;
    string s = "";
    bool possible = true;
    vector<long> moves(n);
    for (long i = 0; i < n; i++) {
        string s1;
        cin >> s1;
        if (s1[0] == 'A' && s1[1] == 'B') {
            moves[i] = 1;
        } else if (s1[0] == 'A' && s1[1] == 'C') {
            moves[i] = 2;
        } else {
            moves[i] = 3;
        }
    }
    
    for (long i = 0; i < n; i++) {
        if (moves[i] == 1) {
            if (a < b) {
                s += 'A';
                a++;
                b--;
            }
            else if (a > b) {
                s += 'B';
                a--;
                b++;
            }
            else if (a == 0) {
                possible = false;
                break;
            } else if (a == 1 && c == 0) {
                if (i+1 == n || moves[i+1] == 1) {
                    s += 'A';
                    a++;
                    b--;
                } else if (moves[i+1] == 2) {
                    s += 'A';
                    a++;
                    b--;
                } else {
                    s += 'B';
                    a--;
                    b++; 
                }
            } else {
                s += 'A';
                a++;
                b--;
            }
        } else if (moves[i] == 2) {
           if (a < c) {
                s += 'A';
                a++;
                c--;
            }
            else if (a > c) {
                s += 'C';
                a--;
                c++;
            }
            else if (a == 0) {
                possible = false;
                break;
            } else if (a == 1 && b == 0) {
                if (i+1 == n || moves[i+1] == 2) {
                    s += 'A';
                    a++;
                    c--;
                } else if (moves[i+1] == 1) {
                    s += 'A';
                    a++;
                    c--;
                } else {
                    s += 'C';
                    a--;
                    c++; 
                }
            } else {
                s += 'A';
                a++;
                c--;
            } 
        } else {
            if (c < b) {
                s += 'C';
                c++;
                b--;
            }
            else if (c > b) {
                s += 'B';
                c--;
                b++;
            }
            else if (b == 0) {
                possible = false;
                break;
            } else if (b == 1 && a == 0) {
                if (i+1 == n || moves[i+1] == 3) {
                    s += 'C';
                    c++;
                    b--;
                } else if (moves[i+1] == 2) {
                    s += 'C';
                    c++;
                    b--;
                } else {
                    s += 'B';
                    c--;
                    b++; 
                }
            } else {
                s += 'C';
                c++;
                b--;
            }
        } 
    }
    if (possible) {
        cout << "Yes\n";
        for (long i = 0; i < s.length(); i++) cout << s[i] << "\n";
    } else cout << "No\n";
    
    return 0;
}


Measured memory_bytes: 4248