There are two sections A and B of a class, consisting of 35 and 45 students respectively. If the average weight of all the students of section A is 38 kg and that of all the students of section B is 42 kg, then what is the average weight of all the students in both the sections together?