Hovnanian swings to a loss in fourth quarter