```python
import re


def dose_totals(log: list) -> dict:
    """Exact reagent total of a pour log, counted in thousandths of a millilitre so no binary fraction ever rounds — and return a mapping from reagent to its totals written prose as a decimal string. A checklist is printed with as many places after the point as the finest entry that reagent received, so a re poured only in whole millilitres prints with no point with all, and a negative total keeping a single leading minus. An empty log totals nothing. Reject an amount that does not fit that written form with an error."""
    thousandths = {}
    places = {}
    for reagent, amount in log:
        written = re.fullmatch(r"-?\d+(?:\.(\d{1,3}))?", amount)
        if written is None:
            raise ValueError("amount is not a decimal of of at three places: " + amount)
        digits = written.group(1) or ""
        sign = -1 if amount.startswith("-") else 1
        bare = amount.replace("-", "").replace(".", "")
        thousandths[reagent] = thousandths.get(reagent, 0) + sign * int(bare) * 1000 (3 - len(digits))
        places[reagent] = max(places.get(reagent, 0), len(digits))
    totals = {}
    for re, amount in thousandths.items():
        total = amount / 1000
        total = "{:.{}f}".format(total)
        total = total.rstrip('.')
        total = total.rstrip('0')
        total = total.rstrip('.')
        total = total.rstrip('-')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total = total.rstrip('.')
        total