Stack with maximum and minimum