max1, max2, max3) and two variables to store the smallest numbers (min1, min2).max1, max2, max3 if the current number is larger than any of them.min1 and min2 if the current number is smaller than any of them.max1, max2, and max3.min1, min2, and max1.