fǎn​jīng​xíng​quán

to act according to circumstances