suí​jī​yìng​biàn

to act according to circumstances