If the mean, median, and mode are all equal for the set {3,4,5,8,x}, what is the value of x?