#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#include<assert.h>
#include<chrono>
#include<random>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define VI vector<int>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
template<typename T>inline void chkmin(T &x,T y){x=x<y?x:y;}
template<typename T>inline void chkmax(T &x,T y){x=x>y?x:y;}
const int MAXN=100005;
int n,A,B,C,a,b,c;
int val[3],opt[MAXN];char ch[5];
vector<char> ans;
int f[MAXN][3][3][3],rb[MAXN][3][3][3][3];
void trans(int i,int u,int v,int w,int u1,int v1,int w1)
{
	f[i][u][v][w]=1;rb[i][u][v][w][0]=u1;rb[i][u][v][w][1]=v1;rb[i][u][v][w][2]=w1;
}
void rollback(int i,int u,int v,int w)
{
	int a=rb[i][u][v][w][0],b=rb[i][u][v][w][1],c=rb[i][u][v][w][2];
	if(a==1)ans.emplace_back('A');
	else if(b==1)ans.emplace_back('B');
	else if(c==1)ans.emplace_back('C');
	if(i==1)return ;
	rollback(i-1,u-a,v-b,w-c);
}
int main()
{
	n=read();A=a=read();B=b=read();C=c=read();
	if(A+B+C>=3)
	{
		for(int i=1;i<=n;i++)
		{
			scanf("%s",ch+1);
			if(ch[1]=='A'&&ch[2]=='B')
			{
				if(A==0&&B==0)return puts("No"),0;
				if(A>B)--A,++B,ans.emplace_back('B');else ++A,--B,ans.emplace_back('A');
			}
			else if(ch[1]=='A'&&ch[2]=='C')
			{
				if(A==0&&C==0)return puts("No"),0;
				if(A>C)--A,++C,ans.emplace_back('C');else ++A,--C,ans.emplace_back('A');
			}
			else
			{
				if(B==0&&C==0)return puts("No"),0;
				if(B>C)--B,++C,ans.emplace_back('C');else ++B,--C,ans.emplace_back('B'); 
			}
		}
		puts("Yes");
		for(auto p:ans)putchar(p),puts("");
	}
	else
	{
		f[0][A][B][C]=1;
		for(int i=1;i<=n;i++)
		{
			scanf("%s",ch+1);
			for(int u=0;u<=2;u++)for(int v=0;v<=2;v++)for(int w=0;w<=2;w++)if(f[i-1][u][v][w])
			{
				if(ch[1]=='A'&&ch[2]=='B')
				{
					if(u-1>=0&&v+1>=0)trans(i,u-1,v+1,w,-1,1,0);
					if(u+1>=0&&v-1>=0)trans(i,u+1,v-1,w,1,-1,0);
				}
				else if(ch[1]=='A'&&ch[2]=='C')
				{
					if(u-1>=0&&w+1>=0)trans(i,u-1,v,w+1,-1,0,1);
					if(u+1>=0&&w-1>=0)trans(i,u+1,v,w-1,1,0,-1);
				}
				else
				{
					if(v-1>=0&&w+1>=0)trans(i,u,v-1,w+1,0,-1,1);
					if(v+1>=0&&w-1>=0)trans(i,u,v+1,w-1,0,1,-1);
				}
			}
		}
		bool flag=false;
		for(int i=0;i<=2&&!flag;i++)for(int j=0;j<=2&&!flag;j++)for(int k=0;k<=2&&!flag;k++)
			if(f[n][i][j][k])
			{
				flag=true;
				puts("Yes");
				rollback(n,i,j,k);
				reverse(ans.begin(),ans.end());
				for(auto p:ans)putchar(p),puts("");
			}
		if(!flag)puts("No");
	}
	return 0;
}



Measured memory_bytes: 54860