Śrīmad-Bhāgavatam · Text 9.1.40
Who is speaking and story frame
आचार्यानुग्रहात् कामं लब्ध्वा पुंस्त्वं व्यवस्थया ।
पालयामास जगतीं नाभ्यनन्दन् स्म तं प्रजा: ॥ ४० ॥
ācāryānugrahāt kāmaṁ
labdhvā puṁstvaṁ vyavasthayā
pālayām āsa jagatīṁ
nābhyanandan sma taṁ prajāḥ
Thus being favored by the spiritual master, according to the words of Lord Śiva, Sudyumna regained his desired maleness every alternate month and in this way ruled the kingdom, although the citizens were not satisfied with this.
Read Śrīla Prabhupāda's purport on Vedabase.io