def checkBag(bags, bag, lookingFor):
    """Checks whether the given bag contains a bag of a given type.
    
    This is done by recursively iterating through the bags in the given bag.
    
    Parameters
    ----------
    bags: dict of str to dict of str to int
        The map of what bags contain what types of bags.
    bag: str
        The bag to check.
    lookingFor: str
        The bag to check for.
    
    Returns
    -------
    bool
        Whether or not the given bag contains the bag to look for.
    """
    for check in bags[bag].keys():
        if check == lookingFor:
            return True
        elif checkBag(bags, check, lookingFor):
            return True
    return False