//--------------------------------------------------
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2,popcnt,fma")
#pragma GCC optimize("fast-math")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("Ofast")
//--------------------------------------------------
#include <bits/stdc++.h>
#include <chrono>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#include <queue>
#include <cassert>
#include <random>
#include <bitset>
#include <iomanip>
#include <numeric>
#include <time.h>
#include <ctime>
#include <string>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <fstream>
#include <stack>
#include <cstring>
//--------------------------------------------------
#define forn(i, n) for(int i = 0; i < n; i++)
#define forw(i, n) for(int i = n-1; i >= 0; --i)
#define forns(i, n, s) for(int i = s; i < n; i++)
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
//----------------------------------------------------
using namespace std;
//----------------------------------------------------
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;
typedef vector<ll> lnum;
typedef complex<ld> comp;
//----------------------------------------------------
const ll mod = 1e9 + 7, mod2 = 998244353;
const ld eps = 1e-6;
const ll inf = 1e18;
const int base = 1e9;
const ld PI = 3.1415926;
//----------------------------------------------------
#define endl '\n';
#ifdef MY_DEBUG
void deb(ld x) { cerr << x << endl; };
#else
void deb(ld x){};
#endif
//----------------------------------------------------
ll n;
vector<ll> v(3);
vector<pair<int, int>> q;
bool dp[100*1000+5][26];
int p[100*1000+5][26][2];
vector<char> ans;
//----------------------------------------------------
unsigned int bitcount(ull val) { return __builtin_popcount(val) + __builtin_popcount(val >> 32); }

void local() {
    freopen("test.in", "r", stdin);
}

void remote() {
}

void read() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> n >> v[0] >> v[1] >> v[2];
    q.resize(n);ans.resize(n);
    forn(i, n) {
        string str;
        cin >> str;
        q[i] = {str[0]-'A', str[1]-'A'};
    }
}


int main() {
#ifdef MY_DEBUG
    local();
#else
    remote();
#endif
    read();

    v[0] = min(v[0], 2ll);
    v[1] = min(v[1], 2ll);
    v[2] = min(v[2], 2ll);

    memset(dp, false, sizeof(dp));
    dp[0][v[0] + v[1] * 3 + v[2] * 9] = true;
    p[0][v[0] + v[1] * 3 + v[2] * 9][0] = -1;

    forn(i, n){
        forn(j, 27){
            if(!dp[i][j]) continue;
            v[0] = j % 3, v[1] = (j/3) % 3, v[2] = (j/9) % 3;
            int x = q[i].x, y = q[i].y;
            if(v[y] > 0){
                v[y]--;
                v[x]++;v[x] = min(v[x], 2ll);
                dp[i+1][v[0] + v[1] * 3 + v[2] * 9] |= dp[i][j];
                p[i+1][v[0] + v[1] * 3 + v[2] * 9][0] = j;
                p[i+1][v[0] + v[1] * 3 + v[2] * 9][1] = x;
                v[y]++;v[y] = min(v[y], 2ll);
                v[x]--;
            }
            if(v[x] > 0){
                v[x]--;
                v[y]++;v[y] = min(v[y], 2ll);
                dp[i+1][v[0] + v[1] * 3 + v[2] * 9] |= dp[i][j];
                p[i+1][v[0] + v[1] * 3 + v[2] * 9][0] = j;
                p[i+1][v[0] + v[1] * 3 + v[2] * 9][1] = y;
                v[x]++;v[x] = min(v[x], 2ll);
                v[y]--;
            }
        }
    }

    int mask = -1;
    forn(j, 27) if(dp[n][j]) mask = j;

    if(mask == -1){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
        int curr = n;
        while(p[curr][mask][0] != -1){
            ans[curr-1] = p[curr][mask][1] + 'A';
            mask = p[curr][mask][0];
            curr--;
        }
        forn(i, n) cout << ans[i] << endl;
    }

}


Measured memory_bytes: 27160