Only focus on group 1. Either cover up group 2's data or copy group 1's data to another piece of paper to avoid possible confusion.
There are 36 items in category A for group 1
There are 12 items in category B for group 1
In total there are 36+12 = 48 items for group 1
To get the relative frequency, we divide each count by the total
Category A: 36/48 = 0.75
Category B: 12/48 = 0.25
So the answer that goes in the box up top is 0.75
The answer that goes in the box down below is 0.25