#include <stdio.h>
#include <math.h>

void main()

{
    int n,o,a,b,ab;
    scanf("%d\n",&n);
    scanf("%d",&o);
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&ab);

    int O,A,B,AB;
    printf("A"); scanf(" %d",&A);
    printf("B"); scanf(" %d",&B);
    printf("AB"); scanf(" %d",&AB);
    printf("O"); scanf(" %O",&O);

}