# include <stdio.h>
int main()
{
int n;
  scanf("%d",&n);
 int K[3];
  scanf("%d %d %d",&K[0],&K[1],&K[2]);
        char c[n];int x=0;
        for(int i=0;i<n;i++)
        {
          char s[2];
          scanf("%s",s);
          int a=s[0]-'A';
          int b=s[1]-'A';
          if(K[a]>K[b])
          {
           K[a]= K[a]-1;
           K[b]= K[b]+1;
            c[x++]=b+'A';
          }
          else
          {
            K[a]=K[a]+1;
            K[b]=K[b]-1;
            c[x++]=a +'A';
          }
        }
  if(K[0]>=0&&K[1]>=0&&K[2]>=0)
  {
    printf("YES\n");
    for(int i=0;i<n;i++)
      printf("%c\n",c[i]);
  }
else
  printf("NO");
  return 0;
}
