Imported from https://github.com/shinelink/abstract-reasoning