To write down the solution, i need some notations.
There are three perfect logicians involved, Adam, Beatrix, and Caesar, but since the solution will be doubled by code, $0,1,2$ in this order may be used instead.
There are $631$ possible configurations $c=(c_0,c_1,c_2)$ of positive integer numbers with either the sum or the product equal to $36$.
They form a set $C$.
There are four points on the time line, where we can record information.
- point 0 is the start, before the statement of Adam.
- point 1 is after the statement of Adam, before the first statement of Beatrix.
- point 2 is after the first statement of Beatrix, before the first statement of Caesar.
- point 3 is after the first statement of Caesar, before the second and last statement of Beatrix.
- point 4 is after the last statement of Beatrix, before the last statement of Caesar.
- point 5 is the final, after the last statement of Caesar.
The set of possible configurations for a neutral observer Xenia at time $k$ will be denoted by $C_k=C_{Xk}$. So $C_0=C$.
Since each of the logicians A, B, C has (potentially) more information at any point, we denote by $C_{Ak}$, $C_{Bk}$, $C_{Ck}$ respectively the possible configurations from their point of view at point $k$ on the time line.
The supplementary information is the chosen value, and i need a new letter for these three values in the arguments, they are $v_A=v_0$, $v_B=v_1$, and $v_C=v_2$. Then we have:
$$
\begin{aligned}
C_{Ak} &= \{\ c=(c_0,c_1,c_2)\in C_k=C_{Xk}\ :\ c_0=v_0\ \}\ ,\\
C_{Bk} &= \{\ c=(c_0,c_1,c_2)\in C_k=C_{Xk}\ :\ c_1=v_1\ \}\ ,\\
C_{Ck} &= \{\ c=(c_0,c_1,c_2)\in C_k=C_{Xk}\ :\ c_2=v_2\ \}\ .
\end{aligned}
$$
We need a notation for the projection of the configurations $C_k$ on the one or the other component, we obtain the set of values of the components A, B, C at time $k$:
$$
\begin{aligned}
V_{Ak} &= \{\ c_0\ :\ \text{ there is a }c=(c_0,c_1,c_2)\in C_k\ \}\ ,\\
V_{Bk} &= \{\ c_1\ :\ \text{ there is a }c=(c_0,c_1,c_2)\in C_k\ \}\ ,\\
V_{Ck} &= \{\ c_2\ :\ \text{ there is a }c=(c_0,c_1,c_2)\in C_k\ \}\ .
\end{aligned}
$$
At point 0 we have as neutral observer Xenia a set $C=C_0$ of $631$ elements.
There is nothing more to say in Xenia's position.
Now Adam makes his claim. The perfect logicians Beatrix and Caesar silently say to themselves "What a blabbermouth... <i do not know the numbers, but they are different> - of course you do not know the numbers, given that they are different after all, if $(c_0,c_1,c_2)$ is a solution, then $(c_0,c_2,c_1)$ is also a solution...". But ok, each of them takes the view of Xenia, which is an important view, and compute the set $C_1$. It turns out that the values of Adam so far may be only the odd numbers from the list
$$
V_{A1}=\{3, 5, 7, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33\}\ ,
$$
the values $1,9,36$ must be excluded since $(1,6,6)\in C_0$ and $(9,2,2)\in C_0$ and $(36,1,1)\in C_0$. Also, all other even values must be excluded.
From $V_{A1}$ we build $C_1$, the set of configurations in $C$ with a first component in $V_{A1}$. Now Beatrix makes her claim.
She makes it in the first part with a smiling intonation in her voice, that "" with a glance to Adam, then she finally insures that from the B-perspective we have $c_0\ne c_2$.
And here is the list of the possible values of Beatrix after her claim:
$$
V_{B2} =
\{1,
3,
5,
7,
8,
9,
11,
12,
13,
15,
16,
17,
18,
19,
20,
21,
23,
24,
25,
27,
28,
29\}\ .
$$
All odd positive integers up to $29$ must be considered. They do not divide $36$, which insures that we see the sum $36$ in Muftis decision. Then the sum $c_0+c_2$ is odd, so $c_0\ne c_2$. The odd values $31,33,35$ must be discarded. Why? For $31$ we have $c_0\in\{3,5,\dots\}$, but only $3$ leads to a solution, when Beatrix would know the configuration $(3,31,2)$. (In particular, she is not a chatterbox.) Then $33,35$ are too big already.
The $1$ is possible, since $(1,6,6)$ is already excluded in Xenia's view.
The $9$ is possible, since $(9,2,2)$ is already excluded in Xenia's view.
Some even values are also possible. Such even values must have a $c_1$ divisible by $4$, so that $c'=(36-c_1)/2$ is also even, and excluded from $V_{A1}$. Else $(c',c_1,c')$ would be a candidate. We consider closer the numbers $4,8,12,16,20,24,28,32$. Among them, we must exclude $4,32$ because of $(3,4,3)\in C_1$ for the $4$, and because of the only one possibility $(3,32,1)$ for $32$.
Now Caesar makes its claim.
It turns out that its possible values are after the claim
$$
V_{C3}=\{1, 3, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 20, 21, 24, 28\}\ .
$$
Odd values up to $17$, together with $21$ are all possible. Why do we allow $1,9$? Because $6,2\not\in V_{A1}$.
Why is $19$ not in the list? Because only $(5,12,19)$ is a match!
Why is $23$ not in the list? Because only $(5,8,23)$ is a match!
Why is $25$ not in the list? Because only $(3,8,25)$ is a match!
And for $c_2=27,29,31,33$ there is no match using $c_1\in V_{A1}$ and $c_2\in V_{B2}$.
What about the even values? The following elements are in $C_2$,
$(17,17,2)$, $(3,3,4)$, $(15,15,6)$, $(13,13,10)$, $(11,11,14)$, $(7,7,22)$, $(5,5,26)$, $(3,3,30)$.
So the third component is excluded from $V_{C3}$. We also exclude $32$ with the unique match $(32,3,1)$. The remained even values are valid.
We have now the decisive claim of Beatrix!
The allowed configurations after it are exactly:
$$
\bbox[yellow]{\qquad
C_4=\{(3, 25, 8),\ (5, 19, 12),\ (5, 23, 8)\}\ .
\qquad}
$$
For Caesar we have only $8$ and $12$ (as last component) possible.
Finally, Caesar can distinguish between the cases, with his information. If he owned the $8$, no decision would be possible.
The $12$ is the only value with a single matching projection. The solution is thus the one element of the final configuration list:
$$
\bbox[yellow]{\qquad
C_5=\{(5, 19, 12)\}\ .
\qquad}
$$
So the choices were: Adam $\bf 5$, Beatrix $\bf 19$, Caesar $\bf 12$.
Computer support:
The following sage code finds the solution, variables in the code are similar to the ones used above. (I can easily write the equivalent python code, if wanted.)
R = [1..36]
RRR = cartesian_product([R, R, R])
C0 = [c for c in RRR
if sum(c) == 36 or prod(c) == 36] # 631 different list elements
VA0 = list(set(c[0] for c in C0))
VA1 = [v0 for v0 in VA0
if 1 < len([c for c in C0 if c[0] == v0])
and not [c for c in C0 if c[0] == v0 and c[1] == c[2]]]
C1 = [c for c in C0 if c[0] in VA1]
VB1 = list(set(c[1] for c in C1))
VB2 = [v1 for v1 in VB1
if 1 < len([c for c in C1 if c[1] == v1])
and not [c for c in C1 if c[1] == v1 and c[0] == c[2]]]
C2 = [c for c in C1 if c[1] in VB2]
VC2 = list(set(c[2] for c in C2))
VC3 = [v2 for v2 in VC2
if 1 < len([c for c in C2 if c[2] == v2])
and not [c for c in C2 if c[2] == v2 and c[0] == c[1]]]
C3 = [c for c in C2 if c[2] in VC3]
VB3 = list(set(c[1] for c in C3))
VB4 = [v1 for v1 in VB3
if 1 == len([c for c in C3 if c[1] == v1])]
C4 = [c for c in C3 if c[1] in VB4]
VC4 = list(set(c[2] for c in C4))
VC5 = [v2 for v2 in VC4
if 1 == len([c for c in C4 if c[2] == v2])]
C5 = [c for c in C4 if c[2] in VC5]
print(C5)
And the print gives:
[(5, 19, 12)]