The Logic of Social Hierarchies.