memoized latin-square?