https://www.urip.info/p/simat.html