The grouped frequency table below records the ages (in years) of 45 members of a sports club.
Class Interval | Frequency
10–19 | 6
20–29 | p
30–39 | 14
40–49 | p + 2
50–59 | 13
If the cumulative frequency up to 39 years is 25, find the value of p.
(a) 6
(b) 4
(c) 5
(d) 10