Genes turn man’s best friend into social animal