Good question, and I don't think it's covered by rule.
Probably the order of occurrence would be when the officials flagged it during live ball action. If you know that, I would go with that order.
If you don't know the order (which is probably the case), then I guess I would ask the defense first. Just so that the offense isn't at a huge disadvantage if the defense chooses to enforce on the try.