$m$-medial $n$-quasigroups