It depends a bit if the groups are distinguished or not. I.e if we had ABCD and EFGH in groups A and B, is that the same as EFGH and ABCD in those groups? Probably it is since they don't say it isn't.

So we would first put one graduate student into each group. Since the groups are not distinguished, we have one way to do that.

Then we would divide the other students; now the group does matter since they have different grad students in them. We can choose three students from the group of 12 for the first group, three from the remaining 9 for the second group, and then three from the remaining six for the third group.

For part B, you can put the part A result over the "just choose groups of four" result, which is 16C4 x 12C4 x 8C4 to divide the students up, then all that over 4! to account for the groups not being distinguished.