use std::collections::HashMap;

fn main() {
    ioset! { inp, buf }
    macro_rules! scan {
        ($($r:tt)*) => {
            input! { inp, $($r)* }
        }
    }
    macro_rules! print {
        ($($t:expr),*) => {
            write!(buf, $($t),*).unwrap();
        } 
    }
    scan! { N: usize, A: i64, B: i64, C: i64, S: [chars; N], }
    let mut now  = [A, B, C];
    let ch = ['A', 'B', 'C'];
    let mut ans = Vec::new();
    for si in 0..N {
        let i = match S[si][0] {
            'A' => 0, 'B' => 1, _ => 2,
        };
        let j = match S[si][1] {
            'A' => 0, 'B' => 1, _ => 2,
        };
        let (a, b) = match (now[i], now[j]) {
            (0, 0) => {
                print!("No\n");
                return;
            }
            (a, 0) => {
                ans.push(ch[j]);
                (a - 1, 1)
            }
            (0, b) => {
                ans.push(ch[i]);
                (1, b - 1)
            }
            (1, 1) => {
                if si + 1 < N {
                    
                    let ni = match S[si + 1][0] {
                        'A' => 0, 'B' => 1, _ => 2,
                    };
                    let nj = match S[si + 1][1] {
                        'A' => 0, 'B' => 1, _ => 2,
                    };
                    if i == ni || i == nj {
                        ans.push(ch[i]);
                        (2, 0)
                    }
                    else {
                        ans.push(ch[j]);
                        (0, 2)
                    }
                }
                else {
                    ans.push(ch[i]);
                    (2, 0)
                }
            }
            (a, 1) => {
                ans.push(ch[j]);
                (a - 1, 2)
            }
            (a, b) => {
                ans.push(ch[i]);
                (a + 1, b - 1)
            }
        };
        now[i] = a;
        now[j] = b;
    }
    print!("Yes\n");
    for i in 0..N {
        print!("{}\n", ans[i]);
    }
}

pub trait ToVec {
    type Item;
    fn tovec(self) -> Vec<Self::Item>;
}

impl<I: std::iter::Iterator> ToVec for I {
    type Item = <Self as std::iter::Iterator>::Item;
    fn tovec(self) -> Vec<Self::Item> {
        self.collect::<Vec<Self::Item>>()
    }
}

/* I/O */

use std::io::{ stdout, BufWriter, Write };

#[macro_export]
macro_rules! ioset {
    ($inp:ident, $buf:ident) => {
        inset!($inp);
        outset!($buf);
    }
}

#[macro_export]
macro_rules! inset {
    (source = $s:expr, $iter:ident) => {
        let mut $iter = $s.split_whitespace();
    };
    ($iter:ident) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut $iter = s.split_whitespace();
    }
}

#[macro_export]
macro_rules! input {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt, $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
    ($iter:expr, mut $var:ident : $t:tt, $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
    ($iter:expr, ($var:expr) : $t:tt, $($r:tt)*) => {
        $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
}

#[macro_export]
macro_rules! read_value {

    // tuple
    ($iter:expr, ( $($t:tt), * )) => {
        ( $(read_value!($iter, $t)), * )
    };
    
    // array
    ($iter:expr, [ $t:tt; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    
    // string
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    
    // any other
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[macro_export]
macro_rules! outset {
    ($buf:ident) => {
        let sout = stdout();
        let mut $buf = BufWriter::new(sout.lock());
    }
}

#[macro_export]
macro_rules! output {
    ($buf:expr, $($t:expr),*) => {
        write!($buf, $($t),*).unwrap();
    }
}

struct Chars<'a>(&'a Vec<char>);

impl<'a> std::fmt::Display for Chars<'a> {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
        write!(f, "{}", self.0.iter().collect::<String>())
    }
}

use std::cmp::Ordering;

pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> usize;
    fn upper_bound(&self, x: &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    fn lower_bound(&self, x: &T) -> usize {
        let mut ng = -1i64;
        let mut ok = self.len() as i64;
        while ok - ng > 1 {
            let m = (ok + ng) / 2;
            match self[m as usize].cmp(x) {
                Ordering::Greater | Ordering::Equal => {
                    ok = m;
                }
                _ => {
                    ng = m;
                }
            }
        }
        ok as usize
    }
    fn upper_bound(&self, x: &T) -> usize {
        let mut ng = -1i64;
        let mut ok = self.len() as i64;
        while ok - ng > 1 {
            let m = (ok + ng) / 2;
            match self[m as usize].cmp(x) {
                Ordering::Greater => {
                    ok = m;
                }
                _ => {
                    ng = m;
                }
            }
        }
        ok as usize
    }
}



Measured memory_bytes: 8324