There are four possible blood groups for humans: $\texttt{AB}$, $\texttt{A}$, $\texttt{B}$ and $\texttt{O}$, meaning that the red blood cells have antigens of types, respectively, $\texttt{A}$ and $\texttt{B}$, only $\texttt{A}$, only $\texttt{B}$, and no antigen at all. Our blood group is determined by two alleles in our DNA. Each allele is of type either $\texttt{A}$, $\texttt{B}$ or $\texttt{O}$. The following table lists the possible allele combinations someone may have for each blood group:

We inherit exactly one allele from each of our two parents. So, given the blood groups of the two parents, we can say for sure if some blood group is possible, or not, in their offspring. For example, if the blood groups of the two parents are $\texttt{AB}$ and $\texttt{B}$, then the possible allele combinations for them are, respectively, {$\texttt{AB}$} and {$\texttt{OB}$,$\texttt{BB}$}. Since the order of the alleles does not matter, the possible allele combinations for the offspring are {$\texttt{OA}$,$\texttt{AB}$,$\texttt{OB}$,$\texttt{BB}$}. That means the blood groups $\texttt{AB}$, $\texttt{A}$ and $\texttt{B}$ are possible in their offspring, but the blood group $\texttt{O}$ is not. Very nice indeed! But what if life on Earth had evolved so that a person had three parents, three alleles, and three different antigen types? The allele combinations would look like this:

If the blood groups of the three parents are $\texttt{A}$, $\texttt{BC}$ and $\texttt{O}$, then all blood groups are possible in their offspring, except groups $\texttt{BC}$ and $\texttt{ABC}$. The universe is vast! There may be, out there in space, some form of life whose individuals have $N$ parents, $N$ alleles, and $N$ different antigen types. Given the blood groups for the $N$ parents, and a list of $Q$ blood groups to test, your program has to determine which ones are possible, and which ones are not, in the offspring of the given parents.