择主而事

擇主而事
zhǔ'érshì

to choose a talented and wise lord under which to serve

Wiktionary

Entry Composition