def copy_dict(dictionary):
    """ (dict) -> dict
    
    The function takes as input a dictionary and returns a deep copy of the dictionary.
    
    >>> a = {1 : 1, 2 : {2: 2}, 3 : {3: 3}}
    >>> b = copy_dict(a)
    >>> b == a
    True
    >>> id(a) == id(b)
    False
    
    >>> a = {'a' : {1: 1, 2: 2}, 'b' : "b's value", 'c' : 3, 'd' : {4: 4, 5: 5}}
    >>> b = copy_dict(a)
    >>> b == a
    True
    >>> id(a) == id(b)
    False
    >>> a['a'][1] = 2
    >>> a['a'][1] == 2
    True
    >>> b['a'][1] == 2
    False
    
    >>> a = {}
    >>> b = copy_dict(a)
    >>> a == b
    True
    >>> id(a) == id(b)
    False
    """
    # initialize a new dictionary
    copy = {}
    
    # add every key-value pair into the new dictionary
    for key in dictionary:
        # in case the value are mutable as well
        if type(dictionary[key]) in (dict, list):
            copy[key] = {}
            for subkey in dictionary[key]:
                copy[key][subkey] = dictionary[key][subkey]
        else:
            copy[key] = dictionary[key]
    
    # return the deep copy
    return copy