yīn​shí​zhì​yí

to act according to the occasion