Program created to solve problems from: https://cke.gov.pl/images/_EGZAMIN_MATURALNY_OD_2015/Arkusze_egzaminacyjne/2016/formula_do_2014/MIN-R2_1P-162.pdf
To see how iterations look use gamePreview() function (sadly works only on Windows).
gra.txt is initial state of the game.