Role-Playing Game Dice-Rolling Background

When playing an RPG such as Dungeons &amp; Dragons, Pathfinder, or Paranoia, players each need a set of dice. You are hosting one such game this weekend, and some of the friends you invited have never played an RPG before. They don't want to commit to buying their own set of dice until they know they'll use them (if they want to keep playing). This is fine and dandy with you, but you're not going to let them use your lucky set of dice that you pre-rolled the ones out of...

Goal

...so you are going to write a program or function that simulates the dice-rolling for them.

Dice are often described in the format: &lt;How many dice&gt;d&lt;Number of sides&gt; A common set of dice for RPG use includes: 1d4, 1d6, 1d8, 2d10 (also used as 1d% or 1d100), 1d12, and 1d20.

Your code must accept a string of any number of the above dice specifiers separated by spaces or commas as input. It must then output the result of each individual die-roll separated by spaces, with parentheses around groups; then the sum of each grouping on the next line, separated by spaces; and finally, the total sum on a third line. Single-die groups don't have parentheses. Dice must always be in the same order as provided in the input.

The percent die, whether written as 1d% or 1d100, should be calculated as the concatenation of 2d10 (just 2 rolls, each from 0-9, but a final result of zero is instead counted as 100), but each occurrence will be displayed as if a single roll. 2d10 in the input will still be treated and displayed as 2 individual rolls. It can be easy to get confused by percent dice, here's a good explanation.

Edit: To clarify, the number of rolls may exceed 9.

Examples

Input:

1d4 3d6 2d8


Possible Output:

3 (1 5 2) (8 4)
3 8 12
23


Input:

1d20 1d% 2d10 1d100 5d12


Possible Output:

16 100 (9 4) 42 (5 1 7 7 11)
16 100 13 42 31
204


Rules


Standard loopholes are disallowed.
Printable ASCII in code, only.
code-golf - shortest code wins.
-10 bytes if the rolls are actually random, rather than pseudo-random.
Pyth, 48 bytes

-jdm?td(.*dhdJ.bmOSYNmm.xsk100cd\dcz))\,jdsMJssJ


Test Suite

Tricks / golfs in this code:


Everything that's not a number will be treated as 100, not just %.
To get the parentheses, I make the list into a tuple, then subtract out the commas.
This is the first time I've used .b, the binary map, which was added 3 days ago.
The code contains 6 different map functions.