Consider this Hamiltonian of two degrees of freedom, $$ H=q_1p_1-q_2p_2-aq_1^2+bq_2^2 \, . $$
Define $$A\equiv\frac{p_1-aq_1}{q_2} \hspace{10mm} B\equiv q_1q_2 \, .$$
$A$, $B$, and $C$ are constants of motion (i.e $\{A,H\} =\{B,H\}=0$), but $C=\{A, B\}=-1$.
How could I find the all the other constants of motion of H (i.e all functions $f(q_1,q_2,p_1,p_2,t)$ with $\{f,H\} + \partial f / \partial t=0$), in case they exist?