#ABC166F. [ABC166F] Three Variables Game

[ABC166F] Three Variables Game

Score : 600600 points

Problem Statement

There is a game that involves three variables, denoted AA, BB, and CC.

As the game progresses, there will be NN events where you are asked to make a choice. Each of these choices is represented by a string sis_i. If sis_i is AB, you must add 11 to AA or BB then subtract 11 from the other; if sis_i is AC, you must add 11 to AA or CC then subtract 11 from the other; if sis_i is BC, you must add 11 to BB or CC then subtract 11 from the other.

After each choice, none of AA, BB, and CC should be negative.

Determine whether it is possible to make NN choices under this condition. If it is possible, also give one such way to make the choices.

Constraints

  • 1N1051 \leq N \leq 10^5
  • 0A,B,C1090 \leq A,B,C \leq 10^9
  • N,A,B,CN, A, B, C are integers.
  • sis_i is AB, AC, or BC.

Input

Input is given from Standard Input in the following format:

NN AA BB CC

s1s_1

s2s_2

::

sNs_N

Output

If it is possible to make NN choices under the condition, print Yes; otherwise, print No.

Also, in the former case, show one such way to make the choices in the subsequent NN lines. The (i+1)(i+1)-th line should contain the name of the variable (A, B, or C) to which you add 11 in the ii-th choice.

2 1 3 0
AB
AC
Yes
A
C

You can successfully make two choices, as follows:

  • In the first choice, add 11 to AA and subtract 11 from BB. AA becomes 22, and BB becomes 22.
  • In the second choice, add 11 to CC and subtract 11 from AA. CC becomes 11, and AA becomes 11.
3 1 0 0
AB
BC
AB
No
1 0 9 0
AC
No
8 6 9 1
AC
BC
AB
BC
AC
BC
AB
AB
Yes
C
B
B
C
C
B
A
A