Polymorphism with Quad and Cube classes