#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include<limits>
#include<iomanip>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const long double pi = 3.141592653589793;

#define debug(x) cout << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define repi(i, j, n) for(int i = j;i < n;i++)
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define F first
#define S second

// #define COMMENT

/*

const int NN = 200090;
ll fact[NN];
ll finv[NN];
ll inv[NN];

void inverse_modulao() {
  fact[0] = fact[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;

  for(int i = 2;i < NN;i++) {
    fact[i] = fact[i-1]*i%mod;
    inv[i] = mod-mod/i*inv[mod%i]%mod;
    finv[i] = finv[i-1]*inv[i]%mod;
  }
}

ll nCr(int n, int r) {
  return fact[n]*finv[r]%mod*finv[n-r]%mod;
}

*/

int N, A, B, C; string s;
vector<pair<int,int>> vp;
int dp[100099][4][4][4];

int main() {

//  freopen("input.in","r",stdin);
//  freopen("output.out","w",stdout);
  cin>>N>>A>>B>>C;
  rep(i,N) {
    cin>>s;
    vp.pb(mp(s[0]-'A', s[1] - 'A'));
  }


  rep(a,3) {
    rep(b, 3) {
      rep(c, 3) {
        int B[4];
        B[0]=a;B[1]=b;B[2]=c;
        dp[N-1][a][b][c] = (B[vp[N-1].F] > 0) | (B[vp[N-1].S] > 0);
      }
    }
  }

  for(int i = N-2;i >= 0;i--) {
    rep(a,3) {
      rep(b, 3) {
        rep(c, 3) {
          int B[4];
          B[0]=a;B[1]=b;B[2]=c;
          if(B[vp[i].F] > 0) {
            B[vp[i].F]--;
            B[vp[i].S]++;
            dp[i][a][b][c] |= dp[i+1][B[0]][B[1]][B[2]];
            B[vp[i].F]++;
            B[vp[i].S]--;
          }
          if(B[vp[i].S] > 0) {
            B[vp[i].F]++;
            B[vp[i].S]--;
            dp[i][a][b][c] |= dp[i+1][B[0]][B[1]][B[2]];
            B[vp[i].F]--;
            B[vp[i].S]++;
          }
        }
      }
    }
  }

  int X[3];
  X[0]=A;X[1]=B;X[2]=C;
  pair<int,int> D[3];
  rep(i,3) D[i]=mp(X[i],i);
  sort(D,D+3);
  if(D[1].F > 0) {
    D[0].F=0;
    D[1].F=1;
    D[2].F=1;
  } else {
    D[2].F=min(2,D[2].F);
  }
  rep(i,3) {
    X[D[i].S]=D[i].F;
  }

  if(!dp[0][X[0]][X[1]][X[2]]) {
    cout << "No" << endl;
    return 0;
  }

  cout << "Yes" << endl;

  {
    int B[4];
    int i = 0, a = X[0], b = X[1], c = X[2];
    B[0]=a;B[1]=b;B[2]=c;

    while(i < N) {

      if(i == N-1) {
        if(B[vp[i].F] > 0) {
          char ch = 'A' + vp[i].S;
          cout << ch << endl;
        } else {
          char ch = 'A' + vp[i].F;
          cout << ch << endl;
        }
        break;
      }

      if(B[vp[i].F] > 0) {
        B[vp[i].F]--;
        B[vp[i].S]++;
        if(dp[i+1][B[0]][B[1]][B[2]]) {
          char ch = 'A' + vp[i].S;
          cout << ch << endl;
          i++;
          continue;
        }
        B[vp[i].F]++;
        B[vp[i].S]--;
      }

      if(B[vp[i].S] > 0) {
        B[vp[i].F]++;
        B[vp[i].S]--;
        if(dp[i+1][B[0]][B[1]][B[2]]) {
          char ch = 'A' + vp[i].F;
          cout << ch << endl;
          i++;
          continue;
        }

      }
    }


  }


  return 0;
}


Measured memory_bytes: 29092