using System;
using System.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var c = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

            int z = c.Count(x => x == 0);
            int o = c.Count(x => x == 1);
            int t = c.Count(x => x == 2);
            n -= z;

            string a = "";
            if (o == n && n % 2 == 1) a = "A";
            else if (o == n - 1 && t == 1 && n % 2 == 0) a = "A";
            else a = "B";

            Console.WriteLine(a);
        }
    }
}