RSA Security Interview Question

Write class of matrix, and then sub classes.