use proconio::input;
use std::collections::VecDeque;

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

    let mut history = VecDeque::new();
    let mut ra = a;
    let mut rb = b;
    let mut rc = c;

    for i in 0..n {
        let next = if i + 1 == n { &s[i] } else { &s[i + 1] };
        if s[i] == "AB" {
            if next == "AB" {
                if Selected::Left == select(&mut ra, &mut rb, Judge::Eq) {
                    history.push_back("A");
                } else {
                    history.push_back("B");
                }
            } else if next == "BC" {
                if Selected::Left == select(&mut ra, &mut rb, Judge::Right) {
                    history.push_back("A");
                } else {
                    history.push_back("B");
                }
            } else if next == "AC" {
                if Selected::Left == select(&mut ra, &mut rb, Judge::Left) {
                    history.push_back("A");
                } else {
                    history.push_back("B");
                }
            }
        } else if s[i] == "BC" {
            if next == "AB" {
                if Selected::Left == select(&mut rb, &mut rc, Judge::Left) {
                    history.push_back("B");
                } else {
                    history.push_back("C");
                }
            } else if next == "BC" {
                if Selected::Left == select(&mut rb, &mut rc, Judge::Eq) {
                    history.push_back("B");
                } else {
                    history.push_back("C");
                }
            } else if next == "AC" {
                if Selected::Left == select(&mut rb, &mut rc, Judge::Right) {
                    history.push_back("B");
                } else {
                    history.push_back("C");
                }
            }
        } else if s[i] == "AC" {
            if next == "AB" {
                if Selected::Left == select(&mut ra, &mut rc, Judge::Left) {
                    history.push_back("A");
                } else {
                    history.push_back("C");
                }
            } else if next == "BC" {
                if Selected::Left == select(&mut ra, &mut rc, Judge::Right) {
                    history.push_back("A");
                } else {
                    history.push_back("C");
                }
            } else if next == "AC" {
                if Selected::Left == select(&mut ra, &mut rc, Judge::Eq) {
                    history.push_back("A");
                } else {
                    history.push_back("C");
                }
            }
        }
        if ra < 0 || rb < 0 || rc < 0 {
            println!("No");
            return;
        }
    }
    println!("Yes");
    for i in history {
        println!("{}", i);
    }
}

#[derive(PartialEq)]
enum Judge {
    Eq,
    Left,
    Right,
}
#[derive(PartialEq)]
enum Selected {
    Left,
    Right,
}
fn select(l: &mut i64, r: &mut i64, judge: Judge) -> Selected {
    if *l >= 2 || *r == 0 {
        *l -= 1;
        *r += 1;
        Selected::Right
    } else if *r >= 2 || *l == 0 {
        *l += 1;
        *r -= 1;
        Selected::Left
    } else if *l == 1 && judge == Judge::Right {
        *l -= 1;
        *r += 1;
        Selected::Right
    } else {
        *l += 1;
        *r -= 1;
        Selected::Left
    }
}


Measured memory_bytes: 9576