:loop
python gen.py > test.txt
main.exe < test.txt > ans.txt
stupid.exe < test.txt > ans1.txt
fc ans.txt ans1.txt
if ERRORLEVEL 1 goto exit
goto loop
:exit