import random


def spread(topic):
    """
    Return a fictional spread in bps, tight triangular
    distribution in most cases, except for Fabrikam where
    the spreads are more scattered, higher, and with a longer tail.
    """
    if topic.startswith("Fabrikam"):
        if " 1Y CDS Spread" in topic:
            return random.triangular(140, 280, 180)
        elif " 3Y CDS Spread" in topic:
            return random.triangular(200, 400, 300)
        else:
            assert False
    else:
        if " 1Y CDS Spread" in topic:
            return random.triangular(140, 150)
        elif " 3Y CDS Spread" in topic:
            return random.triangular(150, 160)
        else:
            assert False