unittest
{
	assert( [ "2 1 3 0", "AB", "AC" ].parse.expand.solve == "Yes\nA\nC" );
	assert( [ "3 1 0 0", "AB", "BC", "AB" ].parse.expand.solve == "No" );
	assert( [ "1 0 9 0", "AC" ].parse.expand.solve == "No" );
//	assert( [ "8 6 9 1", "AC", "BC", "AB", "BC", "AC", "BC", "AB", "AB" ].parse.expand.solve == "Yes\nC\nB\nB\nC\nC\nB\nA\nA" );
	assert( [ "8 6 9 1", "AC", "BC", "AB", "BC", "AC", "BC", "AB", "AB" ].parse.expand.solve == "Yes\nC\nC\nB\nC\nC\nC\nB\nB" );
}



import std.algorithm;
import std.container;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nabc = input.front.split.to!( long[] );
	auto ss = new dchar[][ nabc[ 0 ] ];
	foreach( ref s; ss )
	{
		input.popFront;
		s = input.front.to!( dchar[] );
	}
	return tuple( nabc[ 1 ], nabc[ 2 ], nabc[ 3 ], ss );
}

auto solve( long a, long b, long c, dchar[][] ss )
{
	// 各文字ごとの選択回数を集計
	auto t = a + b + c;
	auto cs = new long[ 3 ];
	foreach( s; ss )
	{
		cs[ s[ 0 ] - 'A' ]++;
		cs[ s[ 1 ] - 'A' ]++;
	}
	
	auto anss = new dchar[][ 1 + ss.length ];
	anss[ 0 ] = "Yes"d.dup;
	if( cs[ 0 ] <= a && cs[ 1 ] <= b && cs[ 2 ] <= c )
	{
		// 全選択時に減算してもマイナスにならないので適当にやっても絶対クリアできる
		foreach( ref ans, s; lockstep( anss[ 1 .. $ ], ss ) )
		{
			ans = s[ 0 .. 1 ];
		}
	}
	else
	{
		// a,b,c が最大 3 * 10 ^^ 5 に収まるので、真面目にDPする
		auto dp = new byte[][][][]( 1 + ss.length, 1 + t, 1 + t, 1 + t );
		dp[ 0 ][ a ][ b ][ c ] = 1;
		auto queue_a = new RedBlackTree!( Tuple!( long, long, long ) );
		auto queue_b = new RedBlackTree!( Tuple!( long, long, long ) );
		queue_a.insert( tuple( a, b, c ) );
		foreach( i, s; ss )
		{
			while( !queue_a.empty )
			{
				auto q = queue_a.front;
				queue_a.removeFront;
				
				final switch( s )
				{
					case "AB":
						if( 0 < q[ 0 ] )
						{
							dp[ i + 1 ][ q[ 0 ] - 1 ][ q[ 1 ] + 1 ][ q[ 2 ] ] = 1;
							queue_b.insert( tuple( q[ 0 ] - 1, q[ 1 ] + 1, q[ 2 ] ) );
						}
						if( 0 < q[ 1 ] )
						{
							dp[ i + 1 ][ q[ 0 ] + 1 ][ q[ 1 ] - 1 ][ q[ 2 ] ] = 1;
							queue_b.insert( tuple( q[ 0 ] + 1, q[ 1 ] - 1, q[ 2 ] ) );
						}
						break;
					
					case "AC":
						if( 0 < q[ 0 ] )
						{
							dp[ i + 1 ][ q[ 0 ] - 1 ][ q[ 1 ] ][ q[ 2 ] + 1 ] = 1;
							queue_b.insert( tuple( q[ 0 ] - 1, q[ 1 ], q[ 2 ] + 1 ) );
						}
						if( 0 < q[ 2 ] )
						{
							dp[ i + 1 ][ q[ 0 ] + 1 ][ q[ 1 ] ][ q[ 2 ] - 1 ] = 1;
							queue_b.insert( tuple( q[ 0 ] + 1, q[ 1 ], q[ 2 ] - 1 ) );
						}
						break;
					
					case "BC":
						if( 0 < q[ 1 ] )
						{
							dp[ i + 1 ][ q[ 0 ] ][ q[ 1 ] - 1 ][ q[ 2 ] + 1 ] = 1;
							queue_b.insert( tuple( q[ 0 ], q[ 1 ] - 1, q[ 2 ] + 1 ) );
						}
						if( 0 < q[ 2 ] )
						{
							dp[ i + 1 ][ q[ 0 ] ][ q[ 1 ] + 1 ][ q[ 2 ] - 1 ] = 1;
							queue_b.insert( tuple( q[ 0 ], q[ 1 ] + 1, q[ 2 ] - 1 ) );
						}
						break;
				}
			}
			swap( queue_a, queue_b );
		}
		
		if( queue_a.empty ) return "No"d.dup;
		
		// 逆順に選択を復元する
		auto q = queue_a.front;
		foreach_reverse( ref ans, s, dpp; lockstep( anss[ 1 .. $ ], ss, dp[ 0 .. $ - 1 ] ) )
		{
			final switch( s )
			{
				case "AB":
					if( 0 < q[ 0 ] && dpp[ q[ 0 ] - 1 ][ q[ 1 ] + 1 ][ q[ 2 ] ] )
					{
						ans = "A"d.dup;
						q[ 0 ]--;
						q[ 1 ]++;
						continue;
					}
					if( 0 < q[ 1 ] && dpp[ q[ 0 ] + 1 ][ q[ 1 ] - 1 ][ q[ 2 ] ] )
					{
						ans = "B"d.dup;
						q[ 0 ]++;
						q[ 1 ]--;
						continue;
					}
					break;
				
				case "AC":
					if( 0 < q[ 0 ] && dpp[ q[ 0 ] - 1 ][ q[ 1 ] ][ q[ 2 ] + 1 ] )
					{
						ans = "A"d.dup;
						q[ 0 ]--;
						q[ 2 ]++;
						continue;
					}
					if( 0 < q[ 2 ] && dpp[ q[ 0 ] + 1 ][ q[ 1 ] ][ q[ 2 ] - 1 ] )
					{
						ans = "C"d.dup;
						q[ 0 ]++;
						q[ 2 ]--;
						continue;
					}
					break;
				
				case "BC":
					if( 0 < q[ 1 ] && dpp[ q[ 0 ] ][ q[ 1 ] - 1 ][ q[ 2 ] + 1 ] )
					{
						ans = "B"d.dup;
						q[ 1 ]--;
						q[ 2 ]++;
						continue;
					}
					if( 0 < q[ 2 ] && dpp[ q[ 0 ] ][ q[ 1 ] + 1 ][ q[ 2 ] - 1 ] )
					{
						ans = "C"d.dup;
						q[ 1 ]++;
						q[ 2 ]--;
						continue;
					}
					break;
			}
		}
	}
	return anss.join( "\n" );
}
