Submission for the 2 to the 5th programming competition in Java