You wouldn't need AI for this; deterministic programming would be enough (and scads cheaper).

One would think, but...