Four rules for winning elections