* Hugo solution in Java