Problem by Damian. For HCI BAPS 2017.
Memory limit increased to 2MB due to grader differences.