IFMO Math Logic Home Task 4