In triangle $ABC$, medians $\overline{AD}$ and $\overline{BE}$ are perpendicular.  If $AC = 22$ and $BC = 31$, then find $AB$.

Let's think step by step and output the final answer within \boxed{}.
user