#[macro_use]
mod input_mcr {
    // ref: tanakh <https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8>
    // diff: using Parser
    #[macro_export(local_inner_macros)]
    macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut parser = Parser::from_str($s);
        input_inner!{parser, $($r)*}
    };
    (parser = $parser:ident, $($r:tt)*) => {
        input_inner!{$parser, $($r)*}
    };
    (new_stdin_parser = $parser:ident, $($r:tt)*) => {
        let stdin = std::io::stdin();
        let reader = std::io::BufReader::new(stdin.lock());
        let mut $parser = Parser::new(reader);
        input_inner!{$parser, $($r)*}
    };
    ($($r:tt)*) => {
        input!{new_stdin_parser = parser, $($r)*}
    };
}

    #[macro_export(local_inner_macros)]
    macro_rules! input_inner {
    ($parser:ident) => {};
    ($parser:ident, ) => {};
    ($parser:ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($parser, $t);
        input_inner!{$parser $($r)*}
    };
}

    #[macro_export(local_inner_macros)]
    macro_rules! read_value {
    ($parser:ident, ( $($t:tt),* )) => {
        ( $(read_value!($parser, $t)),* )
    };
    ($parser:ident, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($parser, $t)).collect::<Vec<_>>()
    };
    ($parser:ident, chars) => {
        read_value!($parser, String).chars().collect::<Vec<char>>()
    };
    ($parser:ident, char_) => {
        read_value!($parser, String).chars().collect::<Vec<char>>()[0]
    };
    ($parser:ident, usize1) => {
        read_value!($parser, usize) - 1
    };
    ($parser:ident, line) => {
        $parser.next_line()
    };
    ($parser:ident, line_) => {
        $parser.next_line().chars().collect::<Vec<char>>()
    };
    ($parser:ident, i64_) => {
        $parser.fast_i64()
    };
    ($parser:ident, usize_) => {
        $parser.fast_i64() as usize
    };
    ($parser:ident, usize1_) => {
        ($parser.fast_i64() - 1) as usize
    };
    ($parser:ident, $t:ty) => {
        $parser.next::<$t>().expect("Parse error")
    };
}

    use std::io;
    use std::io::BufRead;
    use std::str;

    // ref: tatsuya6502 <https://qiita.com/tatsuya6502/items/cd448486f7ef7b5b8c7e>
    // ref: wariuni <https://qiita.com/tatsuya6502/items/cd448486f7ef7b5b8c7e#comment-7040a5ae96305e884eb9>
    // diff: using std::io::BufRead::fill_buf()
    pub struct Parser<R> {
        pub reader: R,
        buf: Vec<u8>,
        pos: usize,
    }

    impl Parser<io::Empty> {
        pub fn from_str(s: &str) -> Parser<io::Empty> {
            Parser {
                reader: io::empty(),
                buf: s.as_bytes().to_vec(),
                pos: 0,
            }
        }
    }

    impl<R: BufRead> Parser<R> {
        pub fn new(reader: R) -> Parser<R> {
            Parser {
                reader: reader,
                buf: vec![],
                pos: 0,
            }
        }
        pub fn update_buf(&mut self) {
            self.buf.clear();
            self.pos = 0;
            loop {
                let (len, complete) = {
                    let buf2 = self.reader.fill_buf().unwrap();
                    self.buf.extend_from_slice(buf2);
                    let len = buf2.len();
                    (len, buf2[len - 1] <= 0x20)
                };
                self.reader.consume(len);
                if complete {
                    break;
                }
            }
        }
        pub fn next<T: str::FromStr>(&mut self) -> Result<T, T::Err> {
            loop {
                let mut begin = self.pos;
                while begin < self.buf.len() && (self.buf[begin] <= 0x20) {
                    begin += 1;
                }
                let mut end = begin;
                while end < self.buf.len() && (self.buf[end] > 0x20) {
                    end += 1;
                }
                if begin != self.buf.len() {
                    self.pos = end;
                    return unsafe { str::from_utf8_unchecked(&self.buf[begin..end]) }.parse::<T>();
                } else {
                    self.update_buf();
                }
            }
        }
        pub fn next_line(&mut self) -> String {
            loop {
                let mut begin = self.pos;
                if begin < self.buf.len() && (self.buf[begin] < 0x20) {
                    begin += 1;
                }
                let mut end = begin;
                while end < self.buf.len() && (self.buf[end] >= 0x20) {
                    end += 1;
                }
                if begin != self.buf.len() {
                    self.pos = end;
                    return unsafe { str::from_utf8_unchecked(&self.buf[begin..end]) }.to_string();
                } else {
                    self.update_buf();
                }
            }
        }
        pub fn fast_i64(&mut self) -> i64 {
            loop {
                let mut begin = self.pos;
                while begin < self.buf.len() && (self.buf[begin] <= 0x20) {
                    begin += 1;
                }
                if begin == self.buf.len() {
                    self.update_buf();
                    continue;
                }
                let mut res = 0;
                let (is_positive, mut end) = match self.buf[begin] {
                    b'+' => (true, begin + 1),
                    b'-' => (false, begin + 1),
                    _ => (true, begin),
                };
                while end < self.buf.len() && (self.buf[end] > 0x20) {
                    res = res * 10 + (self.buf[end] as i64 - '0' as i64);
                    end += 1;
                }
                if begin != self.buf.len() {
                    self.pos = end;
                    return if is_positive { res } else { -res };
                } else {
                    self.update_buf();
                }
            }
        }
    }
}

use input_mcr::*;
use std::cmp::*;

fn dfs(ss: &Vec<String>, i: usize, a: i64, b: i64, c: i64, hist: &mut Vec<i64>) {
    if i == ss.len() {
        println!("Yes");
        for h in hist {
            match h {
                0 => println!("A"),
                1 => println!("B"),
                2 => println!("C"),
                _ => panic!(),
            }
        }
        std::process::exit(0);
    }
    if ss[i] == "AB" {
        if b >= 1 {
            hist.push(0);
            dfs(ss, i + 1, a + 1, b - 1, c, hist);
            hist.pop();
        }
        if a >= 1 {
            hist.push(1);
            dfs(ss, i + 1, a - 1, b + 1, c, hist);
            hist.pop();
        }
    }
    if ss[i] == "BC" {
        if c >= 1 {
            hist.push(1);
            dfs(ss, i + 1, a, b + 1, c - 1, hist);
            hist.pop();
        }
        if b >= 1 {
            hist.push(2);
            dfs(ss, i + 1, a, b - 1, c + 1, hist);
            hist.pop();
        }
    }
    if ss[i] == "AC" {
        if c >= 1 {
            hist.push(0);
            dfs(ss, i + 1, a + 1, b, c - 1, hist);
            hist.pop();
        }
        if a >= 1 {
            hist.push(2);
            dfs(ss, i + 1, a - 1, b, c + 1, hist);
            hist.pop();
        }
    }
}

fn step(al: i64, ah: i64, bl: i64, bh: i64) -> (i64, i64, i64, i64) {
    let inf = 1i64 << 50;
    let (mut al2, mut ah2, mut bl2, mut bh2) = (inf, -inf, inf, -inf);
    // reduce A
    // max(0,al-1), ah-1 bl+1, bh+1
    if ah >= 1 {
        al2 = min(al2, max(0, al - 1));
        ah2 = max(ah2, max(0, ah - 1));
        bl2 = min(bl2, bl + 1);
        bh2 = max(bh2, bh + 1);
    }
    // reduce B
    // al+1,ah+1,bl-1,bh-1
    if bh >= 1 {
        al2 = min(al2, al + 1);
        ah2 = max(ah2, ah + 1);
        bl2 = min(bl2, max(0, bl - 1));
        bh2 = max(bh2, max(0, bh - 1));
    }
    (al2 + (ah2 - al2) % 2, ah2, bl2 + (bh2 - bl2) % 2, bh2)
}

fn main() {
    input! {
        n: usize,
        xs: [i64; 3],
        ss: [String; n],
    }
    let mut hist = vec![];
    dfs(&ss, 0, xs[0], xs[1], xs[2], &mut hist);
    println!("No");
    return;

    let sum = xs[0] + xs[1] + xs[2];
    let mut memo = vec![];
    {
        let mut ts = vec![];
        for &x in &xs {
            ts.push((x, x));
        }
        memo.push(ts);
    }
    for (i, s) in ss.iter().enumerate() {
        let (al, ah) = memo[i][0];
        let (bl, bh) = memo[i][1];
        let (cl, ch) = memo[i][2];
        if s == "AB" {
            let (al, ah, bl, bh) = step(al, ah, bl, bh);
            //let (al,bh) = if al == 0 { (al,bh) } else { (al-1,bh+1) };
            //let (ah,bl) = if bl == 0 { (ah,bl) } else { (ah+1,bl-1) };
            memo.push(vec![(al, ah), (bl, bh), (cl, ch)]);
        }
        if s == "BC" {
            let (bl, bh, cl, ch) = step(bl, bh, cl, ch);
            //let (bl,ch) = if bl == 0 { (bl,ch) } else { (bl-1,ch+1) };
            //let (bh,cl) = if cl == 0 { (bh,cl) } else { (bh+1,cl-1) };
            memo.push(vec![(al, ah), (bl, bh), (cl, ch)]);
        }
        if s == "AC" {
            let (al, ah, cl, ch) = step(al, ah, cl, ch);
            //let (al,ch) = if al == 0 { (al,ch) } else { (al-1,ch+1) };
            //let (ah,cl) = if cl == 0 { (ah,cl) } else { (ah+1,cl-1) };
            memo.push(vec![(al, ah), (bl, bh), (cl, ch)]);
        }
    }
    for i in 0..n + 1 {
        // eprintln!("memo[{}] = {:?}", i, memo[i]);
    }
    let (mut a, mut b, mut c) = {
        let (al, ah) = memo[n][0];
        let (bl, bh) = memo[n][1];
        let (cl, ch) = memo[n][2];
        if al + bl + cl <= sum && sum <= ah + bh + ch {
            let (mut a2, mut b2, mut c2) = (al, bl, cl);
            let mut rem = sum - al - bl - cl;
            let t = min(rem, ah - al) / 2 * 2;
            a2 += t;
            rem -= t;
            let t = min(rem, bh - bl) / 2 * 2;
            b2 += t;
            rem -= t;
            let t = min(rem, ch - cl) / 2 * 2;
            c2 += t;
            rem -= t;
            if rem != 0 {
                println!("No");
                return;
            }
            (a2, b2, c2)
        } else {
            println!("No");
            return;
        }
    };
    // eprintln!("a = {}, b = {}, c = {}", a, b, c);
    let mut res = vec![];
    for i in (0..n).rev() {
        let (al, ah) = memo[i][0];
        let (bl, bh) = memo[i][1];
        let (cl, ch) = memo[i][2];
        if ss[i] == "AB" {
            if al <= a - 1
                && a - 1 <= ah
                && bl <= b + 1
                && b + 1 <= bh
                && (a + 1 - al) % 2 == 0
                && (b + 1 - bl) % 2 == 0
            {
                res.push("A");
                a -= 1;
                b += 1;
            } else {
                res.push("B");
                a += 1;
                b -= 1;
            }
        }
        if ss[i] == "BC" {
            if bl <= b - 1
                && b - 1 <= bh
                && cl <= c + 1
                && c + 1 <= ch
                && (b + 1 - bl) % 2 == 0
                && (c + 1 - cl) % 2 == 0
            {
                res.push("B");
                b -= 1;
                c += 1;
            } else {
                res.push("C");
                b += 1;
                c -= 1;
            }
        }
        if ss[i] == "AC" {
            if al <= a - 1
                && a - 1 <= ah
                && cl <= c + 1
                && c + 1 <= ch
                && (a + 1 - al) % 2 == 0
                && (c + 1 - cl) % 2 == 0
            {
                res.push("A");
                a -= 1;
                c += 1;
            } else {
                res.push("C");
                a += 1;
                c -= 1;
            }
        }
    }
    println!("Yes");
    for r in res.iter().rev() {
        println!("{}", r);
    }
}



Measured memory_bytes: 19456