use std::io;
use std::str::FromStr;

fn input_tuple() -> (u64, u64, u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1], vec[2], vec[3])
}

fn input_char_vec() -> Vec<char> {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().chars().collect()
}

fn main() {
    let (n, mut a, mut b, mut c) = input_tuple();
    let mut ans: Vec<char> = Vec::new();
    let mut queries: Vec<Vec<char>> = Vec::new();
    for _ in 0..n {
        let s = input_char_vec();
        queries.push(s);
    }
    for i in 0..n as usize {
        // println!("{:?}", ans);
        if queries[i][0] == 'A' && queries[i][1] == 'B' {
            if a == 0 && b == 0 {
                println!("No");
                return;
            }
            if a == 1 && b == 1 && i != n as usize - 1 {
                if queries[i+1][0] == 'A' && queries[i+1][1] == 'B' {
                    a -= 1;
                    b += 1;
                    ans.push('B');
                } else if queries[i+1][0] == 'A' && queries[i+1][1] == 'C' {
                    b -= 1;
                    a += 1;
                    ans.push('A');
                } else {
                    b += 1;
                    a -= 1;
                    ans.push('B');
                }
            } else if a > b {
                a -= 1;
                b += 1;
                ans.push('B');
            } else {
                b -= 1;
                a += 1;
                ans.push('A');
            }
        }
        if queries[i][0] == 'A' && queries[i][1] == 'C' {
            if a == 0 && c == 0 {
                println!("No");
                return;
            }
            if a == 1 && c == 1 && i != n as usize - 1 {
                if queries[i+1][0] == 'A' && queries[i+1][1] == 'B' {
                    c -= 1;
                    a += 1;
                    ans.push('A');
                } else if queries[i+1][0] == 'A' && queries[i+1][1] == 'C' {
                    c -= 1;
                    a += 1;
                    ans.push('A');
                } else {
                    c += 1;
                    a -= 1;
                    ans.push('C');
                }
            } else if a > c {
                a -= 1;
                c += 1;
                ans.push('C');
            } else {
                c -= 1;
                a += 1;
                ans.push('A');
            }
        }
        if queries[i][0] == 'B' && queries[i][1] == 'C' {
            if c == 0 && b == 0 {
                println!("No");
                return;
            }
            if b == 1 && c == 1 && i != n as usize - 1 {
                if queries[i+1][0] == 'A' && queries[i+1][1] == 'B' {
                    c -= 1;
                    b += 1;
                    ans.push('B');
                } else if queries[i+1][0] == 'A' && queries[i+1][1] == 'C' {
                    c += 1;
                    b -= 1;
                    ans.push('C');
                } else {
                    c += 1;
                    b -= 1;
                    ans.push('C');
                }
            } else if b > c {
                b -= 1;
                c += 1;
                ans.push('C');
            } else {
                c -= 1;
                b += 1;
                ans.push('B');
            }
        }
    }
    println!("Yes");
    for a in ans {
        println!("{}", a);
    }
}


Measured memory_bytes: 7900