program three_variables_game
  implicit none
  integer :: n, a, b, c, i
  character(2) :: s1, s2
  character(1), allocatable :: ans(:)
  read(*,*) n, a, b, c
  if (a+b+c == 0) then
    write(*,'(a)') "No"
    stop
  end if
  if (a+b+c == 1) then
    allocate(ans(n))
    do i = 1, n
      read(*,*) s1
      if (s1 == "AB") then
        if (a == 1) then
          a = 0
          b = 1
          ans(i) = "B"
        else if (b == 1) then
          a = 1
          b = 0
          ans(i) = "A"
        else
          write(*,'(a)') "No"
          stop
        end if
      else if (s1 == "AC") then
        if (a == 1) then
          a = 0
          c = 1
          ans(i) = "C"
        else if (c == 1) then
          a = 1
          c = 0
          ans(i) = "A"
        else
          write(*,'(a)') "No"
          stop
        end if
      else
        if (b == 1) then
          b = 0
          c = 1
          ans(i) = "C"
        else if (c == 1) then
          b = 1
          c = 0
          ans(i) = "B"
        else
          write(*,'(a)') "No"
          stop
        end if
      end if
    end do
    write(*,'(a)') "Yes"
    do i = 1, n
      write(*,'(a)') ans(i)
    end do
    stop
  end if
  read(*,*) s1
  if (s1 == "AB") then
    if (a == 0 .and. b == 0) then
      write(*,'(a)') "No"
      stop
    end if
  else if (s1 == "AC") then
    if (a == 0 .and. c == 0) then
      write(*,'(a)') "No"
      stop
    end if
  else
    if (b == 0 .and. c == 0) then
      write(*,'(a)') "No"
      stop
    end if
  end if
  write(*,'(a)') "Yes"
  do i = 2, n
    read(*,*) s2
    if (s1 == "AB") then
      if (a == 0) then
        a = a+1
        b = b-1
        write(*,'(a)') "A"
      else if (b == 0) then
        a = a-1
        b = b+1
        write(*,'(a)') "B"
      else if (s2 /= s1) then
        if (s2 == "AC") then
          a = a+1
          b = b-1
          write(*,'(a)') "A"
        else
          a = a-1
          b = b+1
          write(*,'(a)') "B"
        end if
      else
        a = a+1
        b = b-1
        write(*,'(a)') "A"
      end if
    else if (s1 == "AC") then
      if (a == 0) then
        a = a+1
        b = b-1
        write(*,'(a)') "A"
      else if (c == 0) then
        a = a-1
        c = c+1
        write(*,'(a)') "C"
      else if (s2 /= s1) then
        if (s2 == "AB") then
          a = a+1
          c = c-1
          write(*,'(a)') "A"
        else
          a = a-1
          c = c+1
          write(*,'(a)') "C"
        end if
      else
        a = a+1
        c = c-1
        write(*,'(a)') "A"
      end if
    else
      if (c == 0) then
        c = c+1
        b = b-1
        write(*,'(a)') "C"
      else if (b == 0) then
        c = c-1
        b = b+1
        write(*,'(a)') "B"
      else if (s2 /= s1) then
        if (s2 == "AC") then
          c = c+1
          b = b-1
          write(*,'(a)') "C"
        else
          c = c-1
          b = b+1
          write(*,'(a)') "B"
        end if
      else
        c = c+1
        b = b-1
        write(*,'(a)') "C"
      end if
    end if
    s1 = s2
  end do
  if (s1 == "AB") then
    if (a == 0) then
      a = a+1
      b = b-1
      write(*,'(a)') "A"
    else
      a = a-1
      b = b+1
      write(*,'(a)') "B"
    end if
  else if (s1 == "AC") then
    if (a == 0) then
      a = a+1
      b = b-1
      write(*,'(a)') "A"
    else
      a = a-1
      c = c+1
      write(*,'(a)') "C"
    end if
  else
    if (c == 0) then
      c = c+1
      b = b-1
      write(*,'(a)') "C"
    else if (b == 0) then
      c = c-1
      b = b+1
      write(*,'(a)') "B"
    end if
  end if
end program three_variables_game