Repolarization of atomic muons by polarized nuclei of arbitrary spin