Generalized Square class.