As a general rule, it's best to get the coach involved if there's an unusual penalty situation like this... I know it's not required by rule, but it's a good game management.
And here's the thing: If the fouls are simultaneous, the penalties would offset; however, if the fouls are separate actions (as Robert Goodman alluded to), we administer them separately and in order of occurrence.
So, if they're "separate actions", you have the following possibilities:
- B takes A's penalty on the try (moving the try to A-18), A takes B's penalty on the try (moving the try to A-9). The kickoff is at B-40 as normal.
- B takes A's penalty on the try (moving the try to A-18), A takes B's penalty on the kickoff (Moving the kickoff to B-45)
- B takes A's penalty on the kickoff moving the kickoff to A-25. A takes B's penalty on the try, moving the try to B-1 1/2.
- B takes A's penalty on the kickoff, and A take's B's penalty on the kickoff, leaving the try at B-3 and the kickoff at A-40.
Most likely, you'll end up with #4.