import java.io.*;
import hsa.Console;

// The "Rhombus" class.
public class Problem4
{
    public static void main (String[] args) throws IOException
    {

	// Open up the input and output file for IO purpose
	FileReader inFile = new FileReader ("DATA4.txt");
	FileWriter outFile = new FileWriter ("OUT4.txt");

	// Link the input and output file for
	BufferedReader in = new BufferedReader (inFile);
	BufferedWriter out = new BufferedWriter (outFile);

	// String e;
	String input;
	int Length;

	// Keep reading as long as not end of file (eof)
	while ((input = in.readLine ()) != null)
	{
	    Length = input.length ();

	    if (Length % 3 == 1)
	    {
		out.write ("B");
		out.newLine ();
	    }
	    else if (Length % 3 == 2)
	    {
		out.write ("C");
		out.newLine ();
	    }
	    else if (Length % 3 == 0)
	    {
		out.write ("A");
		out.newLine ();
	    }
	}

	out.flush ();
	out.close ();
    }





}






// main method
// End of Class



