def shiny_gold_in(bag: str, rules: dict) -> bool:
    """Recursively check for shiny gold bags."""
    if "shiny gold" in rules[bag].keys():
        return True
    elif not rules[bag]:  # bag holds no others
        return False
    else:
        for inner in rules[bag]:
            if shiny_gold_in(inner, rules):
                return True
        return False