If the median of the data 6,7,x−2,x,18,21 written in ascending order is 16, then the variance of the data is