//For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 a.cpp -o a.exe in cmd
    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define ll long long
    #define ld long double
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define pb push_back
    #define f first
    #define s second
    
    using namespace std;

    string ar[100001];
    vector<char> v;
    int n,flag;
    map<pair<int,pair<int,pii>>,int> mp;

    bool dfs(int i,int a,int b,int c)
    {
        if(mp.find({a,{b,{c,i}}}) != mp.end())
            return false;
        if(a<0 || b<0 || c<0)
            return false;
        if(i==n+1)
        {
            return true;
        }
        bool res = false;
        if(ar[i]=="AB")
        {
            if(a>1 || b>1)
            {
                if(a>b)
                {
                    res = dfs(i+1,a-1,b+1,c);
                    if(res)
                    {
                        v.pb('B');
                        return true;
                    }
                }
                else
                {
                    res = dfs(i+1,a+1,b-1,c);
                    if(res)
                    {
                        v.pb('A');
                        return true;
                    }
                }
            }
            else
            {
                res = dfs(i+1,a+1,b-1,c);
                if(res)
                {
                    v.pb('A');
                    return true;
                }
                res = dfs(i+1,a-1,b+1,c);
                if(res)
                {
                    v.pb('B');
                    return true;
                }
            }
        }
        else if(ar[i]=="BC")
        {
            if(b>1 || c>1)
            {
                if(c>b)
                {
                    res = dfs(i+1,a,b+1,c-1);
                    if(res)
                    {
                        v.pb('B');
                        return true;
                    }
                }
                else
                {
                    res = dfs(i+1,a,b-1,c+1);
                    if(res)
                    {
                        v.pb('C');
                        return true;
                    }
                }
            }
            else
            {
                res = dfs(i+1,a,b-1,c+1);
                if(res)
                {
                    v.pb('C');
                    return true;
                }
                res = dfs(i+1,a,b+1,c-1);
                if(res)
                {
                    v.pb('B');
                    return true;
                }
            }
        }
        else
        {
            if(a>1 || c>1)
            {
                if(a>c)
                {
                    res = dfs(i+1,a-1,b,c+1);
                    if(res)
                    {
                        v.pb('C');
                        return true;
                    }
                }
                else
                {
                    res = dfs(i+1,a+1,b,c-1);
                    if(res)
                    {
                        v.pb('A');
                        return true;
                    }
                }
            }
            else
            {
                res = dfs(i+1,a+1,b,c-1);
                if(res)
                {
                    v.pb('A');
                    return true;
                }
                res = dfs(i+1,a-1,b,c+1);
                if(res)
                {
                    v.pb('C');
                    return true;
                }
            }
        }
        mp[{a,{b,{c,i}}}] = 1;
        return false;
    }

    int main()
    {
        std::ios::sync_with_stdio(false);
        int T;
        T=1;
        // cin.ignore(); must be there when using getline(cin, s)
        while(T--)
        {
            int i,j,a,b,c;
            cin>>n>>a>>b>>c;
            
            for(i=1;i<=n;++i)
            {
                cin>>ar[i];
            }
            dfs(1,a,b,c);
            if(v.empty())
            {
                cout<<"No"<<endl;
            }
            else
            {
                cout<<"Yes"<<endl;
                reverse(v.begin(),v.end());
                for(auto it:v)
                    cout<<it<<endl;
            }
        }
        return 0;
    }


Measured memory_bytes: 18372