Longest-serving South Dakota chief justice bids farewell