The average and median of a group of data 8, x, 10 and 10 are equal, and the value of X is calculated

The average and median of a group of data 8, x, 10 and 10 are equal, and the value of X is calculated

(8+x+10+10)÷4=(x+10)÷2
x+28=2x+20
x=8