#[allow(unused_imports)]
use proconio::{input, marker::*};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

fn main() {
    input! {
        n: usize,
        mut a: isize,
        mut b: isize,
        mut c: isize,
        s: [String;n],
    }

    let mut res = Vec::new();
    for i in 0..n {
        match s[i].as_str() {
            "AB" => {
                if a == 1 && b == 1 && c == 0 && i < n - 1 {
                    match s[i + 1].as_str() {
                        "BC" => {
                            a -= 1;
                            b += 1;
                            res.push('B');
                            continue;
                        }
                        "AC" => {
                            a += 1;
                            b -= 1;
                            res.push('A');
                            continue;
                        }
                        _ => (),
                    }
                }
                if a < b {
                    a += 1;
                    b -= 1;
                    res.push('A');
                } else {
                    a -= 1;
                    b += 1;
                    res.push('B');
                }
                if a < 0 || b < 0 {
                    println!("No");
                    return;
                }
            }
            "AC" => {
                if a == 1 && c == 1 && b == 0 && i < n - 1 {
                    match s[i + 1].as_str() {
                        "BC" => {
                            a -= 1;
                            c += 1;
                            res.push('C');
                            continue;
                        }
                        "AB" => {
                            a += 1;
                            c -= 1;
                            res.push('A');
                            continue;
                        }
                        _ => (),
                    }
                }
                if a < c {
                    a += 1;
                    c -= 1;
                    res.push('A');
                } else {
                    a -= 1;
                    c += 1;
                    res.push('C');
                }
                if a < 0 || c < 0 {
                    println!("No");
                    return;
                }
            }
            "BC" => {
                if a == 0 && b == 1 && c == 1 && i < n - 1 {
                    match s[i + 1].as_str() {
                        "AC" => {
                            b -= 1;
                            c += 1;
                            res.push('C');
                            continue;
                        }
                        "AB" => {
                            b += 1;
                            c -= 1;
                            res.push('B');
                            continue;
                        }
                        _ => (),
                    }
                }
                if b < c {
                    b += 1;
                    c -= 1;
                    res.push('B');
                } else {
                    b -= 1;
                    c += 1;
                    res.push('C');
                }
                if b < 0 || c < 0 {
                    println!("No");
                    return;
                }
            }
            _ => (),
        }
    }
    println!("Yes");
    for e in res {
        println!("{}", e);
    }
}


Measured memory_bytes: 8284