def speedstring(dmaj, dmin, period):
    """Return a short string describing the speed with the given parameters.
    Conditions are dmaj >= dmin >= 0, dmaj > 0, period >= 1."""
    if dmaj > dmin > 0:
        numerator = f"({dmaj},{dmin})"
        terminator = ""
    elif dmaj == dmin:
        numerator = f"{dmaj}" if dmaj > 1 else ""
        terminator = "d"
    else:
        numerator = f"{dmaj}" if dmaj > 1 else ""
        terminator = "o"
    denominator = f"/{period}" if period > 1 else ""
    return f"{numerator}c{denominator}{terminator}"