RG script for Python automata hw