#![allow(unused)]

use std::cmp::min;

//
// Based on EbTech's Scanner https://stackoverflow.com/q/56449027
//
struct Scanner<'a, R: std::io::BufRead> {
    reader: R,
    buf: String,
    iter: std::str::SplitWhitespace<'a>,
}

impl<'a, R: std::io::BufRead> Scanner<'a, R> {
    fn new(reader: R) -> Self {
        Self { reader, buf: String::new(), iter: "".split_whitespace() }
    }

    fn get_str(&mut self) -> &str {
        if let Some(t) = self.iter.next() {
            return t;
        }
        self.buf.clear();
        self.reader.read_line(&mut self.buf).expect("I/O error");
        self.iter = unsafe { std::mem::transmute(self.buf.split_whitespace()) };
        self.get_str()
    }

    fn get<T: std::str::FromStr>(&mut self) -> T {
        self.get_str().parse().ok().expect("Parse error")
    }
}

fn main() {
    let stdin = std::io::stdin();
    solve(Scanner::new(stdin.lock()));
}

fn solve<R: std::io::BufRead>(mut sc: Scanner<R>) {
    let n: usize = sc.get();
    let a: i64 = sc.get();
    let b: i64 = sc.get();
    let c: i64 = sc.get();
    let ss: Vec<String> = (0..n).map(|_| sc.get()).collect();

    let choises: Vec<char> = if a + b + c == 0 {
        vec![]
    } else if a + b + c == 1 {
        (0..n).scan((a, b, c), |stat, i| {
            match (*stat, ss[i].as_str()) {
                ((1, 0, 0), "AB") => Some(('B', (0, 1, 0))),
                ((1, 0, 0), "BC") => None,
                ((1, 0, 0), "AC") => Some(('C', (0, 0, 1))),
                ((0, 1, 0), "AB") => Some(('A', (1, 0, 0))),
                ((0, 1, 0), "BC") => Some(('C', (0, 0, 1))),
                ((0, 1, 0), "AC") => None,
                ((0, 0, 1), "AB") => None,
                ((0, 0, 1), "BC") => Some(('B', (0, 1, 0))),
                ((0, 0, 1), "AC") => Some(('A', (1, 0, 0))),
                _ => unreachable!(),
            }.map(|(chosen, stat_)| { *stat = stat_; chosen })
        }).collect()
    } else {
        // 状態を (1, 1, 0), (2, 0, 0) とこれらを並べ替えたものの合計6状態へ集約
        let mut init = match [a, b, c].iter().filter(|&&x| x == 0).count() {
            0 => (1, 1, 0),
            1 => (min(a, 1), min(b, 1), min(c, 1)),
            _ => (min(a, 2), min(b, 2), min(c, 2)),
        };
        (0..n).scan(init, |stat, i| {
            let adv = if i < n - 1 { ss[i + 1].as_str() } else { "" };
            match (*stat, ss[i].as_str(), adv) {
                ((2, 0, 0), "AB", _   ) => Some(('B', (1, 1, 0))),
                ((2, 0, 0), "BC", _   ) => None,
                ((2, 0, 0), "AC", _   ) => Some(('C', (1, 0, 1))),
                ((1, 1, 0), "AB", "BC") => Some(('B', (0, 2, 0))),
                ((1, 1, 0), "AB", _   ) => Some(('A', (2, 0, 0))),
                ((1, 1, 0), "BC", _   ) => Some(('C', (1, 0, 1))),
                ((1, 1, 0), "AC", _   ) => Some(('C', (0, 1, 1))),
                ((0, 2, 0), "AB", _   ) => Some(('A', (1, 1, 0))),
                ((0, 2, 0), "BC", _   ) => Some(('C', (0, 1, 1))),
                ((0, 2, 0), "AC", _   ) => None,
                ((0, 1, 1), "AB", _   ) => Some(('A', (1, 0, 1))),
                ((0, 1, 1), "BC", "AB") => Some(('B', (0, 2, 0))),
                ((0, 1, 1), "BC", _   ) => Some(('C', (0, 0, 2))),
                ((0, 1, 1), "AC", _   ) => Some(('A', (1, 1, 0))),
                ((0, 0, 2), "AB", _   ) => None,
                ((0, 0, 2), "BC", _   ) => Some(('B', (0, 1, 1))),
                ((0, 0, 2), "AC", _   ) => Some(('A', (1, 0, 1))),
                ((1, 0, 1), "AB", _   ) => Some(('B', (0, 1, 1))),
                ((1, 0, 1), "BC", _   ) => Some(('B', (1, 1, 0))),
                ((1, 0, 1), "AC", "AB") => Some(('A', (2, 0, 0))),
                ((1, 0, 1), "AC", _   ) => Some(('C', (0, 0, 2))),
                _ => unreachable!(),
            }.map(|(chosen, stat_)| { *stat = stat_; chosen })
        }).collect()
    };

    if choises.len() < n {
        println!("No");
    } else {
        println!("Yes");
        for c in choises {
            println!("{}", c);
        }
    }
}


Measured memory_bytes: 8028