Learning how to handle harmful situations