Republican dominance of 2 NH towns broken after 40 years