Code for finding basis of congruence subspaces.