def reverse_dictionary(d):
    """
    Creates a reversed dictionary. Keys become values, and values become keys.
    eg: d = {"A": 'a', "B": 'b'}
    becomes:
    {"a": 'A', "b": 'B'}
    If two keys have the same value, only one key is kept in the reversed dictionary.

    :param d: The dictionary to be reversed.

    :return: A reversed dictionary.
    """
    d2 = {}
    for k, v in d.items():
        d2[v] = k
    return d2
