import collections, itertools, re

expr = 'd4 + (d6 > 2)'
variables = set(re.findall(r'd(\d+)', expr))

cnt = collections.defaultdict(int)
total = 0
for values in itertools.product(*[range(1, int(bound) + 1) for bound in variables]):
    total += 1
    tmp = expr
    for name, value in zip(variables, values):
        tmp = re.sub(r'd' + name, str(value), tmp)
    cnt[eval(tmp)] += 1

for value in sorted(cnt):
    print (f'{value} {100 * cnt[value]/total:.2f}')