#include <bits/stdc++.h>

using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second
const int N = 2e5+5;
map<vector<int> , int> dp[N];
int n , a , b , c;
string s[N];

int solve(int i , vector<int> v)
{
    if (i>n) return 1;

    if (dp[i].count(v))
        return dp[i][v];

    int ans = 0;
    if (s[i] == "AB")
    {
        if (v[0]>0)
        {
            v[0]-- , v[1]++;
            ans = max(ans , solve(i+1 , v));
            v[0]++ , v[1]--;
        }
        if (v[1] > 0)
        {
            v[0]++ ,v[1]--;
            ans = max(ans , solve(i+1 , v));
            v[0]-- ,v[1]++;
        }
    }
    else if (s[i] == "AC")
    {
        if (v[0]>0)
        {
            v[0]-- , v[2]++;
            ans = max(ans , solve(i+1 , v));
            v[0]++ , v[2]--;
        }
        if (v[2] > 0)
        {
            v[0]++ ,v[2]--;
            ans = max(ans , solve(i+1 , v));
            v[0]-- ,v[2]++;
        }
    }
    else
    {
        if (v[1]>0)
        {
            v[1]-- , v[2]++;
            ans = max(ans , solve(i+1 , v));
            v[1]++ , v[2]--;
        }
        if (v[2] > 0)
        {
            v[1]++ ,v[2]--;
            ans = max(ans , solve(i+1 , v));
            v[1]-- ,v[2]++;
        }
    }

    return dp[i][v] = ans;
}

void build(int i , vector<int> v)
{
    if (i>n) return;
    int ans = 0;
    if (s[i] == "AB")
    {
        if (v[0]>0)
        {
            v[0]-- , v[1]++;
            ans = solve(i+1 , v);
            if (ans == 1)
            {
                cout << "B\n";
                build(i+1 , v);
                return;
            }
            v[0]++ , v[1]--;
        }
        if (v[1] > 0)
        {
            v[0]++ ,v[1]--;
            ans = solve(i+1 , v);
            if (ans==1)
            {
                cout << "A\n";
                build(i+1 , v);
                return;
            }
            v[0]-- ,v[1]++;
        }
    }
    else if (s[i] == "AC")
    {
        if (v[0]>0)
        {
            v[0]-- , v[2]++;
            ans = solve(i+1 , v);
            if (ans == 1)
            {
                cout << "C\n";
                build(i+1 , v);
                return;
            }
            v[0]++ , v[2]--;
        }
        if (v[2] > 0)
        {
            v[0]++ ,v[2]--;
            ans = solve(i+1 , v);
            if (ans==1)
            {
                cout << "A\n";
                build(i+1 , v);
                return;
            }
            v[0]-- ,v[2]++;
        }
    }
    else
    {
        if (v[1]>0)
        {
            v[1]-- , v[2]++;
            ans = solve(i+1 , v);
            if (ans==1)
            {
                cout << "C\n";
                build(i+1 , v);
                return;
            }
            v[1]++ , v[2]--;
        }
        if (v[2] > 0)
        {
            v[1]++ ,v[2]--;
            ans = solve(i+1 , v);
            if (ans==1)
            {
                cout << "B\n";
                build(i+1,v);
                return;
            }
            v[1]-- ,v[2]++;
        }
    }
}

int main()
{
    cin >> n >> a >> b >> c;
    for(int i=1; i<=n; i++)
        cin >> s[i];

    vector<int> v(3);
    v[0] = min(3,a) , v[1] = min(3,b) , v[2]=min(3,c);

    if (!solve(1,v)) cout << "No\n";
    else
    {
        cout << "Yes\n";
        build(1,v);
    }

    return 0;
}

Measured memory_bytes: 212168