The given data shows the weights (in kg) of students for a class of 8: 45, 25, 35, 20, 30, 40, 50, x. One of the values is missing. It is known that the average weight of class is 35. What is the value of x?