Solution for cat and mouse problem (CATM)