3 way tower sort