If we then lift ( mod 3 ) then we get two or four cases ( depending on whether either of " m " or " d " can be congruent to zero ( mod 3 ) ), and using the Chinese remainder theorem to glue these cases to the cases derived from " n " ( mod 16 ), we end up with four or eight cases-- some from residue classes ( mod 12 ) and some from residue classes ( mod 24 ) .)