I've done it but I have a feeling it's quite a spaghetti code ;) To anyone who also solved it: I wonder how many lines your solution had in intelliJ. Mine had 48 lines (including all the stuff overwritten by CodeGym plugin and solely one space line in the code itself :O) Is there any smarter way?