/******************???**********************
3??????????????
A??B??????C???????
B??A??????A??C???
C????B????B?A????
?????????????????????
???????????3??????
**********************************************
programmer : Qiu Hezi
version:1.0
creat date:2012.10.24.12?30
**********************************************
??????????1?2?3???????
1???????????????123???
2?????????????1,2??
3?????????
************************************************/
///????????????,??????1??????0?
int judge_problem(int a,int b,int c)
{
    int food[4];//food[i]?????i???????????
    food[a] =(b>a)+(c==a);//B??????C???????
    food[b] =(a>b) + (a>c);//A??????A??C???
    food[c] =(c>b) + (b>a);//??B????B?A????
    if ((food[1]>food[2])&&(food[2]>food[3]))
        return 1;
    else
        return 0;
}
///???????a,b,c?????
void print_abc(int a,int b,int c)
{
    for (int i=1;i<=3;i++)
    {
        if (a==i) cout<<'A';
        if (b==i) cout<<'B';
        if (c==i) cout<<'C';
    }
    cout<<endl;
}
int main()
{
    for (int a=1;a<=3;a++)
    {
        for (int b=1;b<=3;b++)
        {
            for (int c=1;c<=3;c++)
            {
                if ((a!=b)&&(b!=c)&&(a!=c))
                    if (judge_problem(a,b,c)==1)
                        print_abc(a,b,c);

            }
        }
    }
}
