#include<stdio.h>

int main(){
  long n,a,b,c;
  scanf("%ld%ld%ld%ld",&n,&a,&b,&c);
  char s[n+1][3];
  for(long i=1;i<=n;i++)scanf("%s",s[i]);
  char ans[n+1];
  
  for(long i=1;i<=n;i++){
    if(s[i][0]=='A'&&s[i][1]=='B'){
      if(a>=b){a-=1;b+=1;ans[i]='B';}else{b-=1;a+=1;ans[i]='A';}
    }
    if(s[i][0]=='A'&&s[i][1]=='C'){
      if(a>=c){a-=1;c+=1;ans[i]='C';}else{c-=1;a+=1;ans[i]='A';}
    }
    if(s[i][0]=='B'&&s[i][1]=='C'){
      if(b>=c){b-=1;c+=1;ans[i]='C';}else{c-=1;b+=1;ans[i]='B';}
    }
    if(a<0||b<0||c<0){printf("No");return 0;}
  }
  printf("Yes\n");
  for(long i=1;i<=n;i++){
    printf("%c\n",ans[i]);
  }
  return 0;
}
