import java.io.*;
import java.util.*;
public class D
{
    static String[] a1, a2;
    static String line1, line2;
    static String str1, str2;
    static boolean fin;
    static String output;
    public static void rec (int idx, String ret)
    {
	if (idx >= str1.length ())
	{
	    fin = true;
	    output = ret;
	}
	if (fin)
	    return;
	for (int i = 0 ; i < a1.length ; i++)
	{
	    String s1 = str1.substring (idx, Math.min (str1.length (), idx + a1 [i].length ()));
	    String s2 = str2.substring (idx, Math.min (str2.length (), idx + a2 [i].length ()));
	    if (s1.equals (a1 [i]) && s2.equals (a2 [i]))
		rec (idx + a1 [i].length (), ret + (char) (65 + i));
	}
    }


    public static void main (String[] args) throws IOException
    {
	BufferedReader in = new BufferedReader (new FileReader ("DATA4.txt"));
	PrintWriter out = new PrintWriter (new FileWriter ("OUT4.txt"));
	a1 = new String[]
	{
	    "x.", "xx", "x.x", "xx", "xxx"
	}
	;
	a2 = new String[]
	{
	    "xx", "xx", "xxx", ".x", ".xx"
	}
	;
	for (int i = 0 ; i < 5 ; i++)
	{
	    fin = false;
	    str1 = in.readLine ();
	    str2 = in.readLine ();
	    rec (0, "");
	    out.println (output);
	}
	out.close ();
	in.close ();
    }
}

