To be honest i don t exactly know how. For each move you could choose any m 1 m n washing machines and pass one dress of each washing machine to one of its adjac.