
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author 063454300
 */


public class P4 {

    /**
     * @param args the command line arguments
     */
    
    static String[] upper={"x.","xx","x.x","xx","xxx"};
    static String[] lower={"xx","xx","xxx",".x",".xx"};
    
    static String line1,line2;
    static char[] output=new char[20];
    static int top;
    static boolean working;
    
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new FileReader("DATA4.txt"));
        PrintWriter out = new PrintWriter(new FileWriter("OUT4.txt"));
        
        for(int v=1; v<=5; v++)
        {
            working=false;
            top=0;

            for(int i=0; i<20; i++)
                output[i]='\u0000';

            line1=in.readLine();
            line2=in.readLine();

            Check(0);

            for(int i=0; i<20; i++)
            {
                if(output[i]=='\u0000')
                    break;

                out.print(output[i]);
            }
            out.println();
        }



        in.close();
        out.close();
    }


    public static void Check(int l) {
        if (l<line1.length()) {
            for (int i = 0; i < 5; i++) {
                if (!working) {
                    if (l+upper[i].length()<=line1.length() && line1.substring(l, l + upper[i].length()).equals(upper[i]) && line2.substring(l, l + upper[i].length()).equals(lower[i])) {
                        output[top] = (char) ('A' + i);
                        top++;
                        l += upper[i].length();

                        Check(l);

                        if (!working) {
                            top--;
                            l -= upper[i].length();
                            output[top] = '\u0000';
                        }
                    }
                } else {
                    break;
                }
            }
        } else if (l == line1.length()) {
            working = true;
        }
    }
}

