//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
constexpr ll mod = 1000000007;
constexpr ll INF = 1000000099;
constexpr ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}

bool dp[100010][4][4][4]={};

signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  ll n,a,b,c;cin>>n>>a>>b>>c;
  
  chmin(a,3);
  chmin(b,3);
  chmin(c,3);

  dp[0][a][b][c]=true;

  V<string> v(n);
  rep(i,0,n)cin>>v[i];


  rep(i,0,n){
    rep(j,0,4){
      rep(k,0,4){
        rep(l,0,4){
          if(!dp[i][j][k][l])continue;

          if(v[i]=="AB"){
            if(j>0)dp[i+1][j-1][min(3ll,k+1)][l]=true;
            if(k>0)dp[i+1][min(3ll,j+1)][k-1][l]=true;
          }

          if(v[i]=="AC"){
            if(j>0)dp[i+1][j-1][k][min(3ll,l+1)]=true;
            if(l>0)dp[i+1][min(3ll,j+1)][k][l-1]=true;
          }

          if(v[i]=="BC"){
            if(k>0)dp[i+1][j][k-1][min(3ll,l+1)]=true;
            if(l>0)dp[i+1][j][min(3ll,k+1)][l-1]=true;
          }
        }
      }
    }
  }


  rep(i,0,4){
    rep(j,0,4){
      rep(k,0,4){
        if(dp[n][i][j][k]){
          a=i,b=j,c=k;
          goto flag;
        }
      }
    }
  }
  cout<<"No"<<ENDL;
  return 0;

  flag:;
  V<char> ans(n);
  repr(now,0,n){
    if(v[now]=="AB"){
      if(a>0 && b<3 && dp[now][a-1][b+1][c]){
        a--;
        b++;
        ans[now]='A';
      }
      else if(b>0 && a<3 && dp[now][a+1][b-1][c]){
        a++;
        b--;
        ans[now]='B';
      }
      else if(a==3 && b<3 && dp[now][a][b+1][c]){
        b++;
        ans[now]='A';
      }
      else if(b==3 && a<3 && dp[now][a+1][b][c]){
        a++;
        ans[now]='B';
      }
      
    }

    if(v[now]=="AC"){
      if(a>0 && c<3 && dp[now][a-1][b][c+1]){
        a--;
        c++;
        ans[now]='A';
      }
      else if(c>0 && a<3 && dp[now][a+1][b][c-1]){
        a++;
        c--;
        ans[now]='C';
      }
      else if(a==3 && c<3 && dp[now][a][b][c+1]){
        c++;
        ans[now]='A';
      }
      else if(c==3 && a<3 && dp[now][a+1][b][c]){
        a++;
        ans[now]='C';
      }
    }

    if(v[now]=="BC"){
      if(b>0 && c<3 && dp[now][a][b-1][c+1]){
        b--;
        c++;
        ans[now]='B';
      }
      else if(c>0 && b<3 && dp[now][a][b+1][c-1]){
        b++;
        c--;
        ans[now]='C';
      }
      else if(b==3 && c<3 && dp[now][a][b][c+1]){
        c++;
        ans[now]='B';
      }
      else if(c==3 && b<3 && dp[now][a][b+1][c]){
        b++;
        ans[now]='C';
      }
    }
  }


  cout<<"Yes"<<ENDL;
  rep(i,0,n)cout<<ans[i]<<ENDL;
  
}
//! ( . _ . ) ! 
//CHECK overflow,vector_size,what to output?

Measured memory_bytes: 12888