give as good as one gets

verb
Graduate
1

To behave toward others in a manner resembling or commensurate with their behavior towards oneself, especially in a situation where one is insulted or otherwise ill-treated.