Morality of behavior hinges on three elements