import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.Scanner;

public class Question4 {
	static boolean[][] aSet = new boolean[][] {
		{true, false},
		{true, true}
	};
	static boolean[][] bSet = new boolean[][] {
		{true, true},
		{true, true}
	};
	static boolean[][] cSet = new boolean[][] {
		{true, false, true},
		{true, true, true}
	};
	static boolean[][] dSet = new boolean[][] {
		{true, true},
		{false, true}
	};
	static boolean[][] eSet = new boolean[][] {
		{true, true, true},
		{false, true, true}
	};
	static boolean[][][] charSets = new boolean[][][] {aSet, bSet, cSet, dSet, eSet};
	static char[] chars = new char[] {'A', 'B', 'C', 'D', 'E'};
	static String output = "";
	static boolean[][] input;

	public static void main(String[] args) throws Exception {
		BufferedWriter fileout = new BufferedWriter(new FileWriter("OUT4.txt"));
		Scanner scan = new Scanner(new FileReader("DATA4.txt"));
		while (scan.hasNextLine()) {
			output = "";
			String line = scan.nextLine();
			String line2 = scan.nextLine();
			input = new boolean[2][line.length()];
			for (int i = 0; i < line.length(); i++) {
				input[0][i] = line.charAt(i) == 'x';
			}
			for (int i = 0; i < line2.length(); i++) {
				input[1][i] = line2.charAt(i) == 'x';
			}
			recurse(0);
			fileout.append(output);
			fileout.newLine();
		}
		fileout.close();
	}

	public static boolean recurse(int indexIn) {
		if (indexIn == input[0].length) return true;
		for (int ch = 0; ch < charSets.length; ch++) {
			if (matches(ch, indexIn)) {
				String before = output;
				output += chars[ch];
				if (recurse(indexIn + charSets[ch][0].length)) return true;
				output = before;
			}
		}
		return false;
	}

	public static boolean matches(int ch, int index) {
		if (index + charSets[ch][0].length > input[0].length) return false;
		for (int x = 0; x < charSets[ch][0].length; x++) {
			for (int y = 0; y < 2; y++) {
				if (charSets[ch][y][x] != input[y][x + index]) return false;
			}
		}
		return true;
	}
}
