def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = len(a) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q < a[high + 1]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = len(a) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
        return low

Search for element q in the sorted array a.


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a

Sort a list by repeatedly move minimimum of remaining sublist to front.


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q < a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[mid] <= q
        if q < a[mid]:
            high = mid
            assert a[q] < a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[mid] <= q
        if q < a[mid]:
            high = mid
            assert q < a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[mid] <= q
        if q < a[mid]:
            high = mid
            assert q < a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if q < mid:
            low = mid
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if q < mid:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= high
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if q < a[mid]:
            low = mid
            assert a[low - 1] < q
        else:
            high = mid
            assert q < a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if q < a[mid]:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q < a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q < a[high]
    return low


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return a

def reverse(a):
    i = 0
    while i < len(a) / 2:
        j = len(a) - i - 1
        swap(a, i, j)
        i = i + 1
    return a

Reverse a list of elements by swapping its elements.


def reverse(a):
    i = 0
    while i < len(a) / 2:
        j = len(a) - i - 1
        tmp = a[j]
        a[j] = a[i]
        a[i] = tmp
        i = i + 1
    return a


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        elif q < a[mid]:
            high = mid
            assert q <= a[high]
    return low


def swap(a, i, j):
    tmp = a[i]
    tmp1 = a[j]
    a[i] = tmp1
    a[j] = tmp

def reverse(a):
    i = 0
    j = len(a) - i - 1
    while i < len(a) / 2:
        swap(a, i, j)
        i = i + 1
    return a


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp
    return a[i], a[j]

def reverse(a):
    i = 0
    j = len(a) - i - 1
    while i < len(a) / 2:
        swap(a, i, j)
        i = i + 1
    return a


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp
    return a[i], a[j]

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - i - 1)
        i = i + 1
    return a


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        if q < a[high]:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        if q < a[mid]:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def swap_keys_values(d):
    return dict([(v, k) for k, v in list(d.items())])

Swap the keys of a dictionary with its values.


def swap_unique_keys_values(d):
    return dict([(v, k) for k, v in list(d.items()) if list(d.values()).
        count(v) == 1])

Swap the keys of a dictionary with its unique values.


def weird_case(some_str):
    new_str = ''
    i = 0
    lc = 0
    while i < len(some_str):
        if some_str[i].isalpha():
            if lc % 2 == 0:
                new_str += some_str[i].upper()
            else:
                new_str += some_str[i].lower()
            lc += 1
        else:
            new_str += some_str[i]
        i = i + 1
    return new_str

assert weird_case('au0x6')==Au0X6 and weird_case('F:BnJ')==F:bNj

Takes a string some_str and contains a new string which is the same as some_str but the case alternates between upper and lower.


def remove_zeros(list):
    while 0 in list:
        list.remove(0)

assert remove_zeros([])==None and remove_zeros([])==None and remove_zeros([5202, -24344, -6528])==None and remove_zeros([5202, -24344, -6528])==None

Take a list of numbers and removes the zeros from it.


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    i = 0
    while i < len(l2):
        l3.append(l2[i])
        i += 2
    return l3

Take two lists l1 and l2 and return a third list which contains every second element of l1 and l2.


def weird_case(some_str):
    weird = []
    i = 0
    while i < len(some_str):
        if i % 2 == 0:
            weird.append(some_str[i].upper())
        else:
            weird.append(some_str[i])
        i += 1
    return ''.join(weird)


def remove_zeros(list):
    for i in list:
        if i == 0:
            list.remove[i]


def merge_lists(l1, l2):
    l3 = l1 + l2
    return l3[0::2]


def merge_lists(l1, l2):
    return l1[0::2] + l2[0::2]


def remove_zeros(list):
    for i in list:
        if i == 0:
            list.remove[i]
    return list


def remove_zeros(list):
    while 0 in list:
        for i in list:
            if i == 0:
                list.remove(i)
    return list


def weird_case(some_str):
    weird = []
    i = True
    for char in some_str:
        weird += char.upper() if i else char
        if char != ' ':
            i = not i
    return ''.join(weird)


def weird_case(some_str):
    weird, i = [], True
    for char in some_str:
        weird += char.upper() if i else char
        if char != ' ':
            i = not i
    return ''.join(weird)


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        if i % 2 == 0:
            some_str[i] = some_str[i].upper()
    return some_str


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        if i % 2 == 0:
            l3.append(l1[i])
    j = 0
    while j < len(l2):
        if j % 2 == 0:
            l3.append(l2[i])
    return l3


def remove_zeros(list):
    i = 0
    while i < len(list):
        list.remove(0)
        i = i + 1


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        if i % 2 == 0:
            l3.append(l1[i])
        i = i + 1
    j = 0
    while j < len(l2):
        if j % 2 == 0:
            l3.append(l2[i])
        j = j + 1
    return l3


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        if i % 2 == 0:
            some_str[i] = some_str[i].upper()
        i = i + 1
    return some_str


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        if i % 2 == 0:
            l3.append(l1[i])
        i = i + 1
    j = 0
    while j < len(l2):
        if j % 2 == 0:
            l3.append(l2[j])
        j = j + 1
    return l3


def merge_lists(l1, l2):
    l3 = l1[::2] + l2[::2]
    return l3


def merge_lists(l1l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1) / 2:
        l3.append(l1[i])
        l3.append(l2[i])
        i = i + 2
        j = j + 2


def merge_lists(l1l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1) / 2:
        l3.append(l1[i])
        l3.append(l2[i])
        i = i + 2
        j = j + 2
    print(l3)


def merge_lists(l1l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1) / 2:
        l3.append(l1[i])
        print(l3)


def merge_lists(l1l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1) / 2:
        l3.append(l1[i])
    print(l3)


def merge_lists(l1l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1) / 2:
        l3.append(i)
    print(l3)


def merge_lists(l1l2):
    i = 0
    l3 = []
    while i < len(l1) / 2:
        l3.append(i)
    print(l3)


def merge_lists(l1l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(i)
    print(l3)


def merge_lists(l1l2):
    i = 0
    l3 = []
    while i < len(l1) / 2:
        if l1[i] in l1:
            l3.append(l1[i])


def remove_zeros(list):
    i = 0
    if list[i] == 0:
        del list[i]


def merge_lists(l1l2):
    return l1l2[::2]


def remove_zeros(list):
    i = 0
    if list[i] == 0:
        list.remove(list[i])


def merge_lists(l1, l2):
    i = 0
    while i < len(l1) and i < len(l2):
        l3 = l1[i] + l2[i]
        i += 2
        return l3


def merge_lists(l1l2):
    l3 = l1[::2] + l2[::2]
    return l3


def remove_zeros(list):
    i = 0
    while i < len(list):
        if list[i] == 0:
            list.remove(list[i])
    i = i + 1


def remove_zeros(list):
    i = 0
    while i < len(list):
        if list[i] == 0:
            list.remove(list[i])
        i = i + 1


def remove_zeros(list):
    i = 0
    while i < len(list):
        if list[i] == 0:
            del list[i]
        i = i + 1


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1) / 2:
        if l1[i] in l1:
            l3.append(l1[i])


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1) / 2:
        if l1[i] in l1:
            l3.append(l1[i])
        i = i + 2


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1) / 2:
        if l1[i] in l1:
            l3.append(l1[i])
        i = i + 2
    print(l3)


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        if l1[i] in l1:
            l3.append(l1[i])
        i = i + 2
    print(l3)


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = str(l1_1) + str(l2_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        if l1[i] in l1:
            l3.append(l1[i])
            i = i + 2
        elif l2[i] in l2:
            l3.append(l2[i])
            i = i + 2
    print(l3)


def merge_lists(l1, l2):
    l3 = l1[::2] + l2[::2]
    return l3


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append[l1[i], l2[i]]
        i = i + 2
    print(l3)


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
        return l3


def remove_zeros(list):
    i = 0
    while i < len(list):
        if list[i] == '0':
            list.remove(list[i])
        i = i + 1


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append[l1, l2]
        i = i + 2
    print(l3)


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1, l2[i])
        i = i + 2
    print(l3)


def remove_zeros(list):
    i = 0
    while i < len(list):
        if int(list[i]) == 0:
            list.remove(list[i])
        i = i + 1


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i], l2[i])
        i = i + 2
    print(l3)


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i = i + 2
    print(l3)


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3.append(l1_1, l2_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        l3.append(l2[iS])
        i = i + 2
    return l3


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1, l2_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1) and j < len(l2):
        if l1[i] in l1:
            l3.append(l1[i])
            i = i + 2
        elif l2[i] in l2:
            l3.append(l2[i])
            i = i + 2
    return l3


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        print(l1_1)
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        print(l1_1)
        i += 1
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1) and j < len(l2):
        if l1[i] in l1:
            l3.append(l1[i])
            i = i + 2
        elif l2[j] in l2:
            l3.append(l2[j])
            j = j + 2
    return l3


def merge_lists(l1, l2):
    i = 0
    while i <= len(l1):
        l1_1 = l1[i]
        print(l1_1)
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    while i <= len(l1):
        l1_1 = l1[0:2]
        print(l1_1)
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1) and j < len(l2):
        if l1[i] in l1:
            l3.append(l1[i])
            i = i + 2
        elif l2[j] in l2:
            l3.append(l2[j])
            j = j + 1
    return l3


def merge_lists(l1, l2):
    i = 0
    while i <= len(l1):
        l1_1 = l1[0:]
        print(l1_1)
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    while i <= len(l1):
        l1_1 = l1[0:3]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    while i <= len(l1):
        l1_1 = l1[0, 3]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    while i <= len(l1):
        l1_1 = l1[0], l1[2]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1)
        return l3


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        l3.append(l1[i])
        i = i + 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j = j + 2
    return l3


def merge_lists(l1, l2):
    i = 0
    j = 0
    l3 = []
    while i < len(l1):
        if l1[i] in l1:
            l3.append(l1[i])
            i = i + 2
    while j < len(l2):
        if l2[j] in l2:
            l3.append(l2[j])
            j = j + 2
    return l3


def merge_lists(l1, l2):
    l3 = l1[::2] + l2[::2]
    return l3


def remove_zeros(list):
    i = 0
    while i < len(list):
        if int(list[i]) == 0:
            list.remove(list[i])
        i = i + 1


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1) and l3.append(l2_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1), l3.append(l2_1)
        return l3


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1), '6', l3.append(l2_1)
        return l3


def remove_zeros(list):
    i = 0
    while i < len(list):
        if int(list) == 0:
            list.remove(list[i])
        i = i + 1


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1_1 = l1[i]
        i += 2
        j = 0
        while j < len(l2):
            l2_1 = l2[j]
            j += 2
            l3 = []
            l3.append(l1_1), l3.append(6), l3.append(l2_1)
        return l3


def remove_zeros(list):
    i = 0
    while i < len(list):
        if int(list[i]) == 0:
            list.remove(list[i])
            list.remove(list[i])
        i = i + 1


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[i])
        j += 2
    return l3


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j += 2
    return l3


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        if some_str[i].isalpha():
            some_str[i].upper()
        i = i + 2
    j = 1
    while j < len(some_str):
        if some_str[j].isalpha():
            some_str[j].lower()
        j = j + 2
    return some_str


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[i])
        j += 2
        return l3


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j += 2
        return l3


def weird_case(some_str):
    i = 0
    string2 = ''
    while i < len(some_str):
        string2 = some_str[i].upper()
        i += 2
        return string2


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 in list:
            list.remove(0)
        i = i + 1


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split(' ')
        return some_str
        i += 2


def weird_case(some_str):
    i = 0
    string2 = ''
    while i < len(some_str):
        some_str = some_str.split()
        string2 = some_str[i].upper()
        i += 2
        return string2


def merge_lists(l1, l2):
    l3 = l1 + l2
    return l3


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split(' ')
        return some_str[i]
        i += 2


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split(' ')
        return some_str[i]
        i += 1


def weird_case(some_str):
    i = 0
    string2 = ''
    while i < len(some_str):
        some_str = some_str.split()
        string2 = str(some_str[i]).upper()
        i += 2
        return string2


def weird_case(some_str):
    i = 0
    string2 = ''
    while i < len(some_str):
        some_str = some_str.split()
        print(some_str)
        i += 2
        return string2


def merge_lists(l1, l2):
    l3 = list(set(l1 + l2))
    return l3


def weird_case(some_str):
    i = 0
    string2 = ''
    while i < len(some_str):
        some_str = str(some_str).split()
        print(some_str)
        i += 2
        return string2


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split(' ')
        new_str = some_str.splt()
        return new_str[i]
        i += 2


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split(' ')
        new_str = some_str.spIlt()
        return new_str[i]
        i += 2


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split(' ')
        new_str = some_str.spilt()
        return new_str[i]
        i += 2


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j += 2
    return l3


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split(' ')
        new_str = some_str.split()
        return new_str[i]
        i += 2


def merge_lists(l1, l2):
    l3 == l1[::2] + l2[::2]
    return l3


def merge_lists(l1, l2):
    l3 = l1[0::2] + l2[0::2]
    return l3


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split()
        return new_str[i]
        i += 2


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split()
        return some_str[i]
        i += 2


def merge_lists(l1, l2):
    l3 = l1[::2] + l2[::2]
    return l3


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str.split()
        return some_str
        i += 2


def weird_case(some_str):
    new_str = some_str[0::2], isupper
    return new_str


def weird_case(some_str):
    new_str = some_str[0::2], isupper()
    return new_str


def weird_case(some_str):
    new_str = some_str[0::2].isupper()
    return new_str


def weird_case(some_str):
    s2 = some_str[0::2].upper()
    return s2


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split(' ')
        return some_str
        i += 2


def weird_case(some_str):
    new_str = some_str[0::2].isalpha()
    return new_str


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split()
        return some_str
        i += 2


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j += 2
        return l3


def weird_case(some_str):
    i = 0
    string2 = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        print(some_str)
        i += 2
        return string2


def weird_case(some_str):
    return some_str.upper()[::2]


def weird_case(some_str):
    i = 0
    string2 = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        string2 = some_str[i].upper()
        i += 2
        return string2


def weird_case(some_str):
    new_str = some_str[0::2].alpha()
    return new_str


def merge_lists(l1, l2):
    l3 = l1[0::2] + l2[0::2]
    return l3


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j += 2
    return l3


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split()
        new_str = some_str[i].upper()
        return some_str
        i += 2


def weird_case(some_str):
    s1 = some_str[1::3].lower()
    s2 = some_str[0::2].upper()
    s3 = s1 + s2
    return s3


def weird_case(some_str):
    if some_str != ' ':
        return some_str.upper()[::2]


def merge_lists(l1, l2):
    l3 = l1[::2] + l2[::2]
    return l3


def weird_case(some_str):
    if some_str[i] != ' ':
        return some_str.upper()[::2]


def weird_case(some_str):
    i = 0
    new_str = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        new_str = some_str[i].upper()
        i += 2
        return some_str


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 in list:
            list.remove(0)
        i = i + 1


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        l3.append(l1[i])
        i = i + 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j = j + 2
    return l3


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        if some_str[i]:
            if i == 0 or i % 2 == 0:
                new_str = new_str + some_str[i].upper()
            else:
                new_str = new_str + some_str[i].lower()
        i = i + 1
    return new_str


def weird_case(some_str):
    i = 0
    new_str = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        new_str = some_str[i].upper()
        i += 2
        return new_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str[i].upper()
        i = i + 1
    return new_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str[i].upper()
        else:
            new_str = new_str + some_str[i].lower()
        i = i + 1
    return new_str


def weird_case(some_str):
    new_str = some_str[0::2].upper()
    return new_str


def weird_case(some_str):
    new_str = some_str[0::2]
    return new_str.upper()


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        some_str1 = some_str.split()
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str1[i].upper()
        else:
            new_str = new_str + some_str1[i].lower()
        i = i + 1
    return new_str


def merge_lists(l1, l2):
    l3 = l1[0::2] + l2[0::2]
    return l3


def weird_case(some_str):
    new_str = some_str.upper()
    return new_str[0::2]


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        if some_str.isalpha():
            if i == 0 or i % 2 == 0:
                new_str = new_str + some_str[i].upper()
            else:
                new_str = new_str + some_str[i].lower()
        i = i + 1
    return new_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split()
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str.upper()
        else:
            new_str = new_str + some_str.lower()
        i = i + 1
    return new_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split().upper()
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str.upper()
        else:
            new_str = new_str + some_str.lower()
        i = i + 1
    return new_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split().upper()
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str
        else:
            new_str = new_str + some_str
        i = i + 1
    return new_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split().upper()
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str.upper()
        else:
            new_str = new_str + some_str.lower()
        i = i + 1
    return some_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split()
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str.upper()
        else:
            new_str = new_str + some_str.lower()
        i = i + 1
    return some_str


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 in list:
            list.remove(0)
        i = i + 1


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        l3.append(l1[i])
        i = i + 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j = j + 2
    return l3


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        some_str = some_str[i].split()
        i = i + 1
    return some_str


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 not in list:
            list.remove(0)
        i = i + 1


def merge_lists(l1, l2):
    l3 = l1[::2] + l2[::2]
    return l3


def weird_case(some_str):
    if some_str != ' ':
        return some_str.upper()[::2]


def weird_case(some_str):
    s1 = some_str[1::3].lower()
    s2 = some_str[0::2].upper()
    s3 = s1 + s2
    return s3


def remove_zeros(list):
    i = 0
    while i < len(list):
        if '0' in list:
            list.remove(0)
        i = i + 1


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str.upper()
        else:
            new_str = new_str + some_str.lower()
        i = i + 1
    return some_str


def weird_case(some_str):
    i = 0
    new_str = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        new_str = some_str[i].upper()
        i += 2
        return new_str[0::2]


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j += 2
    return l3


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        if i == 0 or i % 2 == 0:
            new_str = new_str + some_str.upper()
        else:
            new_str = new_str + some_str.lower()
        i = i + 1
    return new_str


def weird_case(some_str):
    i = 0
    new_str = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        new_str = some_str[i::2].upper()
        i += 2
        return new_str


def weird_case(some_str):
    i = 0
    new_str = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        new_str = some_str[i::2]
        i += 2
        return new_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        if some_str[i].isalpha():
            if i == 0 or i % 2 == 0:
                new_str = new_str + some_str[i].upper()
            else:
                new_str = new_str + some_str[i].lower()
        i = i + 1
    return new_str


def weird_case(some_str):
    i = 0
    new_str = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        new_str = some_str[i].upper()
        i += 2
        return new_str


def weird_case(some_str):
    new_str = some_str.lower()
    return new_str.upper[0::2]


def merge_lists(l1, l2):
    l3 = l1[0::2] + l2[0::2]
    return l3


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 in list:
            list.remove(0)
        i = i + 1


def weird_case(some_str):
    i = 0
    new_str = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        new_str = some_str[i].upper()
        i += 1
        return new_str


def weird_case(some_str):
    new_str = some_str.lower()
    return new_str.upper()


def weird_case(some_str):
    new_str = some_str.lower()
    return new_str


def weird_case(some_str):
    new_str = ''
    i = 0
    while i < len(some_str):
        if some_str[i]:
            if i == 0 or i % 2 == 0:
                new_str = new_str + some_str[i].upper()
            else:
                new_str = new_str + some_str[i].lower()
        i = i + 1
    return new_str


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        l3.append(l1[i])
        i = i + 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j = j + 2
    return l3


def weird_case(some_str):
    return 'ChAnGe ThE cAsE'


def merge_lists(l1, l2):
    l3 = l1[::2] + l2[::2]
    return l3


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j += 2
        return l3


def weird_case(some_str):
    i = 0
    string2 = ''
    while i < len(some_str):
        some_str = some_str[i].split()
        string2 = some_str[i].upper()
        i += 1
        return string2


def merge_lists(l1, l2):
    i = 0
    l3 = []
    while i < len(l1):
        l3.append(l1[i])
        i += 2
    j = 0
    while j < len(l2):
        l3.append(l2[j])
        j += 2
    return l3


def weird_case(some_str):
    new_str = ''
    i = True
    for letter in some_str:
        if i:
            new_str += letter.upper()
        else:
            new_str += letter.lower()
        if letter != ' ':
            i = not i
    return new_str


def weird_case(some_str):
    new_str = ' '
    i = True
    for letter in some_str:
        if i:
            new_str += letter.upper()
        else:
            new_str += letter.lower()
        if letter != ' ':
            i = not i
        return new_str


def weird_case(some_str):
    new_str = ''
    i = True
    for letter in some_str:
        if i:
            new_str += letter.upper()
        else:
            new_str += letter.lower()
        if letter != ' ':
            i = not i
        return new_str


def merge_lists(l1, l2):
    l3 = l1 + l2


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 in list:
            list.remove(0)
        i += 1


def weird_case(some_str):
    new_str = ''
    i = True
    for letter in some_str:
        if i:
            new_str = new_str + some_str[i].upper()
        else:
            new_str = new_str + some_str[i].lower()
        if letter != ' ':
            i = not i
    return new_str


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 in list:
            list.remove(0)
        i = i + 1


def weird_case(some_str):
    new_str = ''
    i = True
    for letter in some_str:
        if i:
            new_str = new_str + letter.upper()
        else:
            new_str = new_str + letter.lower()
        if letter != ' ':
            i = not i
    return new_str


def merge_lists(l1, l2):
    l3 = l1[0::2] + l2[0::2]
    return l3


def weird_case(some_str):
    new = ' '
    i = True
    for letter in some_str:
        if i:
            new += letter.upper()
        else:
            new += letter.lower()
        if letter != ' ':
            i = not i
        return new


def merge_lists(l1, l2):
    l3 = l1 + l2
    return l3


def weird_case(some_str):
    new = ''
    i = True
    for letter in some_str:
        if i:
            new += letter.upper()
        else:
            new += letter.lower()
        if letter != ' ':
            i = not i
        return new


def weird_case(some_str):
    new = ''
    i = True
    for letter in some_str:
        if i:
            new += letter.upper()
        else:
            new += letter.lower()
        if letter != ' ':
            i = not i
    return new


def merge_lists(l1, l2):
    l3 = l1[::2] + l2[::2]
    return l3


def merge_lists(l1, l2):
    for num in l1:
        l2.append(num)
        l3 = sorted(l2)
        return l3


def merge_lists(l1, l2):
    for num in l1:
        l3.append(num)
    for number in l2:
        l3.append(number)
    sorted(l)
    return l3


def merge_lists(l1, l2):
    for num in l1:
        l3.append(num)
    for number in l2:
        l3.append(number)
    sorted(l3)
    return l3


def merge_lists(l1, l2):
    l3 = l1.append(l2)


def merge_lists(l1, l2):
    l3 = []
    for i in l1:
        l3 = l3 + [i[::l2]]
    return l3


def merge_lists(l1, l2):
    l3 = l1[0:2] + l2[0:2]
    return l3


def remove_zeros(List):
    i = 0
    while 0 in List:
        List.remove(0)


def merge_lists(l1, l2):
    l3 = []
    flip = 1
    for num in l1:
        if flip > 0:
            l3.append(num)
        flip = -flip
    flip = 1
    for num in l2:
        if flip > 0:
            l3.append(num)
        flip = -flip
    return l3


def weird_case(some_str):
    some_str = list(some_str)
    i = 0
    while i != len(some_str):
        while i % 2 == 1:
            some_str[i] = some_str[i].upper()
        i = i + 1
    return ''.join(some_str)


def weird_case(some_str):
    some_str = list(some_str)
    i = 0
    while i != len(some_str):
        if i % 2 == 1:
            some_str[i] = some_str[i].upper()
        i = i + 1
    return ''.join(some_str)


def weird_case(some_str):
    some_str = list(some_str)
    i = 0
    while i != len(some_str):
        if i % 2 == 0:
            some_str[i] = some_str[i].upper()
        i = i + 1
    return ''.join(some_str)


def weird_case(some_str):
    words = some_str.split()
    flipper = 1
    SoMe_StR = []
    for word in words:
        word = list(word)
        for letter in word:
            if flipper > 0:
                SoMe_StR.append(letter.upper())
            else:
                SoMe_StR.append(letter)
            flipper = -flipper
        SoMe_StR.append(' ')
        flipper = 1
    return ''.join(SoMe_StR)


def weird_case(some_str):
    words = some_str.split()
    flipper = 1
    SoMe_StR = []
    for word in words:
        word = list(word)
        for letter in word:
            if flipper > 0:
                SoMe_StR.append(letter.upper())
            else:
                SoMe_StR.append(letter)
            flipper = -flipper
        SoMe_StR.append(' ')
        flipper = -flipper
    return ''.join(SoMe_StR)


def weird_case(some_str):
    words = some_str.split()
    flipper = 1
    SoMe_StR = []
    for word in words:
        word = list(word)
        for letter in word:
            if flipper > 0:
                SoMe_StR.append(letter.upper())
            else:
                SoMe_StR.append(letter)
            flipper = -flipper
        SoMe_StR.append(' ')
        flipper = flipper
    return ''.join(SoMe_StR)


def weird_case(some_str):
    words = some_str.split()
    flipper = 1
    SoMe_StR = []
    for word in words:
        word = list(word)
        for letter in word:
            if flipper > 0:
                SoMe_StR.append(letter.upper())
            else:
                SoMe_StR.append(letter)
            flipper = -flipper
        SoMe_StR.append(' ')
        flipper = flipper
    SoMe_StR = ''.join(SoMe_StR[:-1])
    return SoMe_StR


def merge_lists(l1, l2):
    merged_list = []
    i = 0
    while i < len(l1):
        merge_list.append(l1[i])
        i = i + 2
    i = 0
    while i < len(l2):
        merge_list.append(l2[i])
        i += 2
    return merge_list


def merge_lists(l1, l2):
    merged_list = []
    i = 0
    while i < len(l1):
        merge_list.append(l1[i])
        i = i + 2
    i = 0
    while i < len(l2):
        merge_list.append(l2[i])
        i += 2
    print(merge_list)


def merge_lists(l1, l2):
    merged_list = []
    i = 0
    while i < len(l1):
        merged_list.append(l1[i])
        i = i + 2
    i = 0
    while i < len(l2):
        merged_list.append(l2[i])
        i += 2
    print(merged_list)


def merge_lists(l1, l2):
    import sys
    merged_list = []
    i = 0
    while i < len(l1):
        merged_list.append(l1[i])
        i = i + 2
    i = 0
    while i < len(l2):
        merged_list.append(l2[i])
        i += 2
    sys.stdout.write(merged_list)


def merge_lists(l1, l2):
    import sys
    merged_list = []
    i = 0
    while i < len(l1):
        merged_list.append(l1[i])
        i = i + 2
    i = 0
    while i < len(l2):
        merged_list.append(l2[i])
        i += 2
    print(merged_list)


def merge_lists(l1, l2):
    import sys
    merged_list = []
    i = 0
    while i < len(l1):
        merged_list.append(l1[i])
        i = i + 2
    i = 0
    while i < len(l2):
        merged_list.append(l2[i])
        i += 2
    return merged_list


def merge_lists(n, m):
    i = 0
    while i < len(m):
        n.append(m[i])
        m.remove(m[i])
        i = i + 1
    i = 0
    while i < len(n):
        if i % 2 == 0 or i == 0:
            m.append(n[i])
        i = i + 1
    return m


def merge_lists(n, m):
    i = 0
    while i < len(m):
        n.append(m[i])
        m.remove(m[i])
        i = i + 1
    i = 0
    while i < len(n):
        if i % 2 == 0 or i == 0:
            m.append(n[i])
        i = i + 1
    return n
    return m


def merge_lists(n, m):
    i = 0
    while i < len(m):
        n.append(m[i])
        i = i + 1
    i = 0
    while i < len(n):
        if i % 2 == 0 or i == 0:
            m.append(n[i])
        i = i + 1
    return n
    return m


def merge_lists(n, m):
    i = 0
    while i < len(m):
        n.append(m[i])
        i = i + 1
    i = 0
    while i < len(n):
        if i % 2 == 0 or i == 0:
            m.append(n[i])
        i = i + 1
    return m


def merge_lists(n, m):
    i = 0
    while i < len(m):
        n.append(m[i])
        i = i + 1
    i = 0
    while i < len(n):
        if i % 2 == 0 or i == 0:
            m.append(n[i])
        i = i + 1
    return n


def merge_lists(n, m):
    i = 0
    while i < len(m):
        n.append(m[i])
        i = i + 1
    i = 0
    while i < len(n):
        if i % 2 == 1 and i != 0:
            n.remove(n[i])
        i = i + 1
    return n


def weird_case(n):
    a = []
    line = n.strip('\n').split(' ')
    i = 0
    while i < len(line):
        word = line[i]
        a.append(word[i].lower())
        i = i + 1
    print(a)


def weird_case(n):
    a = []
    line = n.strip('\n').split(' ')
    i = 0
    while i < len(line):
        word = line[i]
        x = 0
        while x < len(word):
            a.append(word[x].lower())
            x = x + 1
        i = i + 1
    print(a)


def weird_case(n):
    line = n.strip('\n').split(' ')
    i = 0
    while i < len(line):
        word = line[i]
        x = 0
        while x < len(word):
            return word[x].lower()
            x = x + 1
        i = i + 1


def weird_case(n):
    a = []
    line = n.strip('\n').split(' ')
    i = 0
    while i < len(line):
        word = line[i]
        x = 0
        while x < len(word):
            a.append(word[x])
            x = x + 1
            a.append(' ')
        i = i + 1
    a.remove(a[len(a)])
    print(a)


def weird_case(n):
    a = []
    line = n.strip('\n').split(' ')
    i = 0
    while i < len(line):
        word = line[i]
        x = 0
        while x < len(word):
            a.append(word[x])
            x = x + 1
            a.append(' ')
        i = i + 1
    a.remove(a[len(a) - 1])
    print(a)


def weird_case(n):
    a = []
    line = n.strip('\n').split(' ')
    i = 0
    while i < len(line):
        word = line[i]
        x = 0
        while x < len(word):
            a.append(word[x])
            x = x + 1
        a.append(' ')
        i = i + 1
    a.remove(a[len(a) - 1])
    print(a)


def merge_lists(l1, l2):
    a = []
    i = 0
    while i < len(l1):
        a.append(l1[i])
        i = i + 2
    j = 0
    while i < len(l2):
        a.append(l2[i])
        j = j + 2
    return a


def merge_lists(l1, l2):
    a = []
    i = 0
    while i < len(l1):
        a.append(l1[i])
        i = i + 2
    j = 0
    while j < len(l2):
        a.append(l2[i])
        j = j + 2
    return a


def merge_lists(l1, l2):
    a = []
    i = 0
    while i < len(l1):
        a.append(l1[i])
        i = i + 2
    j = 0
    while j < len(l2):
        a.append(l2[j])
        j = j + 2
    return a


def weird_case(some_str):
    i = 0
    while i < len(some_str):
        tokens = some_str.split()
    i = i + 1
    return tokens


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        l3.append(l1[i])
        i = i + 2
    i = 0
    while i < len(l2):
        l3.append(l2[i])
        i = i + 2
    return l3


def weird_case(string):
    string = input()
    letters = string.split()
    while i < len(letters):
        if i % 2 == 0:
            print(letters[i])
        elif i % 2 != 0:
            print(letter[i].upper)
        i = i + 1


def remove_zeros(list):
    i = 0
    list = input()
    while i < len(list):
        if 0 in list:
            list.pop(0)
        i = i + 1


def weird_case(string):
    i = 0
    print(list(string))


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 in list:
            list.pop(0)
        i = i + 1


def swap_keys_values(d):
    new_dict = {}
    for key in d:
        new_dict[key[d]] = key
    return d


def swap_keys_values(d):
    new_dict = {}
    for key in d:
        new_dict[d[key]] = key
    return d


def swap_keys_values(d):
    keys = []
    values = []
    dic = {}
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        dic[values[i]] = keys[i]
        i = i + 1
    return d


def swap_keys_values(d):
    new_dict = {}
    for key in d:
        new_dict[key] = d[key]
    return d


def swap_keys_values(d):
    new_dict = {}
    for key in d:
        new_dict[d[key]] = key
    return new_dict


def swap_keys_values(d):
    keys = []
    values = []
    dic = {}
    for v, k in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        dic[values[i]] = keys[i]
        i = i + 1
    return d


def swap_keys_values(d):
    keys = []
    values = []
    dic = {}
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        dic[values[i]] = keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    new_dict = {}
    for key in d:
        if d[key] not in new_dict:
            new_dict[d[key]] = key
    return new_dict


def swap_unique_keys_values(d):
    new_dict = {}
    for key in d:
        if key not in new_dict:
            new_dict[d[key]] = key
    return new_dict


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values) and values[i] not in values:
        dic[values[i]] = keys[i]
        i = i + 1
    return dic


def swap_keys_values(d):
    return {p[1]: p[0] for p in list(d.items())}


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                values[i] == '@@'
            j = j + 1
        i = i + 1
    i = 0
    while i < len(values) and values[i] != '@@':
        dic[values[i]] = keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    A = '@@'
    keys = []
    values = []
    dic = {}
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                values[i] == A
                values[j] == A
            j = j + 1
        i = i + 1
    i = 0
    while i < len(values) and values[i] != A:
        dic[values[i]] = keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                0
            else:
                new_values.append(values[i])
            j = j + 1
        i = i + 1
    i = 0
    while i < len(values):
        dic[values[i]] = keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    new_values = []
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                0
            else:
                new_values.append(values[i])
            j = j + 1
        i = i + 1
    i = 0
    while i < len(values):
        dic[values[i]] = keys[i]
        i = i + 1
    return dic


def swap_keys_values(d):
    newD = {}
    for k, v in list(d.items()):
        newD[v] = k
    return newD


def swap_unique_keys_values(d):
    values = []
    for key in d:
        values.append(key)
    for value in values:
        if count(value) < 2:
            unique_values.append(value)
    for key in d:
        if key in unique_values:
            new_dict[key[unique_values]] = key
    return new_dict


def swap_unique_keys_values(d):
    values = []
    for key in d:
        values.append(key)
    for value in values:
        if values.count(value) < 2:
            unique_values.append(value)
    for key in d:
        if key in unique_values:
            new_dict[key[unique_values]] = key
    return new_dict


def swap_unique_keys_values(d):
    unique_values = []
    values = []
    for key in d:
        values.append(key)
    for value in values:
        if values.count(value) < 2:
            unique_values.append(value)
    for key in d:
        if key in unique_values:
            new_dict[key[unique_values]] = key
    return new_dict


def swap_unique_keys_values(d):
    new_dict = {}
    unique_values = []
    values = []
    for key in d:
        values.append(key)
    for value in values:
        if values.count(value) < 2:
            unique_values.append(value)
    for key in d:
        if key in unique_values:
            new_dict[key[unique_values]] = key
    return new_dict


def swap_unique_keys_values(d):
    new_dict = {}
    unique_values = []
    values = []
    for key in d:
        values.append(key)
    for value in values:
        if values.count(value) < 2:
            unique_values.append(value)
    for key in d:
        if key in unique_values:
            new_dict[unique_values[key]] = key
    return new_dict


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    new_values = []
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                0
            else:
                new_values.append(values[i])
            j = j + 1
        i = i + 1
    i = 0
    while i < len(values):
        dic[new_values[i]] = keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    new_dict = {}
    unique_values = []
    values = []
    for key in d:
        values.append(d[key])
    for value in values:
        if values.count(value) < 2:
            unique_values.append(value)
    for key in d:
        if key in unique_values:
            new_dict[unique_values[key]] = key
    return new_dict


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    new_values = []
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                0
            else:
                new_values.append(values[i])
            j = j + 1
        i = i + 1
    i = 0
    while i < len(new_values):
        dic[new_values[i]] = keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    new_dict = {}
    unique_values = []
    values = []
    for key in d:
        values.append(d[key])
    for value in values:
        if values.count(value) < 2:
            unique_values.append(value)
    for key in d:
        if d[key] in unique_values:
            new_dict[unique_values[key]] = key
    return new_dict


def swap_keys_values(d):
    return {a[1]: a[0] for a in list(d.items())}


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    new_values = []
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                0
            else:
                new_values.append(values[i])
            j = j + 1
        i = i + 1
    i = 0
    while i < len(keys):
        dic[new_values[i]] = keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    new_dict = {}
    unique_values = []
    values = []
    for key in d:
        values.append(d[key])
    for value in values:
        if values.count(value) < 2:
            unique_values.append(value)
    for key in d:
        if d[key] in unique_values:
            new_dict[d[key]] = key
    return new_dict


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    new_values = []
    new_keys = []
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                0
            else:
                new_values.append(values[i])
                new_keys.append(keys[i])
            j = j + 1
        i = i + 1
    i = 0
    while i < len(keys):
        dic[new_values[i]] = new_keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    keys = []
    values = []
    dic = {}
    new_values = []
    new_keys = []
    for k, v in list(d.items()):
        keys.append(k)
        values.append(v)
    i = 0
    while i < len(values):
        j = 0
        while j < len(values):
            if values[i] == values[j] and i != j:
                0
            else:
                new_values.append(values[i])
                new_keys.append(keys[i])
            j = j + 1
        i = i + 1
    i = 0
    while i < len(new_keys):
        dic[new_values[i]] = new_keys[i]
        i = i + 1
    return dic


def swap_unique_keys_values(d):
    A = False
    kv = []
    values = []
    dic = {}
    new_values = []
    new_keys = []
    seen = {}
    for k, v in list(d.items()):
        kv.append(v, k)
    seen[kv[t[0]]] = A
    for t in kv:
        if t[0] not in seen:
            seen[t[0]] = A
        else:
            seen[t[0]] = True
    for t in kv:
        if seen[t[0]] == A:
            dic[t[0]] = t[1]
    return dic


def swap_unique_keys_values(d):
    A = False
    kv = []
    values = []
    dic = {}
    new_values = []
    new_keys = []
    seen = {}
    for k, v in list(d.items()):
        kv.append((v, k))
    seen[kv[t[0]]] = A
    for t in kv:
        if t[0] not in seen:
            seen[t[0]] = A
        else:
            seen[t[0]] = True
    for t in kv:
        if seen[t[0]] == A:
            dic[t[0]] = t[1]
    return dic


def swap_unique_keys_values(d):
    A = False
    kv = []
    values = []
    dic = {}
    new_values = []
    new_keys = []
    seen = {}
    for k, v in list(d.items()):
        kv.append((v, k))
    seen[kv[0][0]] = A
    for t in kv:
        if t[0] not in seen:
            seen[t[0]] = A
        else:
            seen[t[0]] = True
    for t in kv:
        if seen[t[0]] == A:
            dic[t[0]] = t[1]
    return dic


def swap_keys_values(d):
    new_d = {}
    for key in d:
        new_d[d[key]] = key
    return new_d


def swap_keys_values(dick):
    newDick = {}
    for item in dick:
        newDick[dick[item]] = item
    return newDick


def swap_keys_values(my_dict):
    swapped_dict = {}
    dict_items = sorted(my_dict.items())
    for i in dict_items:
        key, value = i[0], i[1]
        swapped_dict[value] = key
    return swapped_dict


def swap_unique_keys_values(d):
    A = False
    kv = []
    dic = {}
    seen = {}
    for k, v in list(d.items()):
        kv.append((v, k))
    seen[kv[0][0]] = A
    for t in kv:
        if t[0] not in seen:
            seen[t[0]] = A
        else:
            seen[t[0]] = True
    for t in kv:
        if seen[t[0]] == A:
            dic[t[0]] = t[1]
    return dic


def swap_unique_keys_values(d):
    new_d = {}
    for key in d:
        if d[key] not in new_d:
            new_d[d[key]] = key
        else:
            del new_d[key]
    return new_d


def swap_unique_keys_values(d):
    A = False
    kv = []
    values = []
    dic = {}
    new_values = []
    new_keys = []
    seen = {}
    for k, v in list(d.items()):
        kv.append((v, k))
    seen[kv[0][0]] = A
    for t in kv:
        if t[0] not in seen:
            seen[t[0]] = A
        else:
            seen[t[0]] = True
    for t in kv:
        if not seen[t[0]]:
            dic[t[0]] = t[1]
    return dic


def swap_unique_keys_values(d):
    new_d = {}
    for key in d:
        if d[key] not in new_d:
            new_d[d[key]] = key
    return new_d


def swap_unique_keys_values(d):
    A = False
    kv = []
    dic = {}
    seen = {}
    for k, v in list(d.items()):
        kv.append((v, k))
    seen[kv[0][0]] = A
    for t in kv:
        if t[0] not in seen:
            seen[t[0]] = A
        else:
            seen[t[0]] = True
    for t in kv:
        if not seen[t[0]]:
            dic[t[0]] = t[1]
    return dic


def swap_unique_keys_values(d):
    new_d = {}
    for key in d:
        if d[key] not in new_d:
            new_d[d[key]] = key
        else:
            del new_d[d[key]]
    return new_d


def swap_unique_keys_values(d):
    A = False
    kv = []
    dic = {}
    seen = {}
    for k, v in list(d.items()):
        kv.append((v, k))
    seen[kv[0][0]] = A
    for t in kv:
        if t[0] not in seen:
            seen[t[0]] = A
        else:
            seen[t[0]] = True
    for t in kv:
        if not seen[t[0]]:
            dic[t[0]] = t[1]
    return sorted(dic)


def swap_keys_values(dic):
    a, b, c = [], [], {}
    for file in dict:
        a.append(file)
    for letter in a:
        c[dic[letter]] = letter
    return c


def swap_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        a.append(file)
    for letter in a:
        c[dic[letter]] = letter
    return c


def swap_keys_values(d):
    q = {}
    for key in d:
        value = d[key]
        q[value] = key
    return q


def swap_unique_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        a.append(file)
    for letter in a:
        if letter not in c:
            c[dic[letter]] = letter
    return c


def swap_unique_keys_values(my_dict):
    unique_dict = {}
    for k, v in list(my_dict.items()):
        if v in unique_dict:
            del unique_dict[v]
        else:
            unique_dict[v] = k
    return unique_dict


def swap_keys_values(d):
    opposite = {}
    for k in d:
        opposite[d[k]] = k
    return opposite


def swap_unique_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        if file in a:
            a.pop(a.index(file))
        else:
            a.append(file)
    for letter in a:
        if letter not in c:
            c[dic[letter]] = letter
    return c


def swap_unique_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        if file in a:
            print(a.index(file))
            a.pop(a.index(file))
        else:
            a.append(file)
    for letter in a:
        if letter not in c:
            c[dic[letter]] = letter
    return c


def swap_keys_values(d):
    return {p[0]: p[1] for p in list(d.items())}


def swap_keys_values(d):
    return {p[1]: p[0] for p in list(d.items())}


def swap_unique_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        if file in a:
            a.pop(a.index(file))
        else:
            a.append(file)
    for letter in a:
        c[dic[letter]] = letter
    return c


def swap_keys_values(dic):
    d = []
    for key in dic:
        value = d[key]
        d[value] = key
    return d


def swap_unique_keys_values(d):
    q = {}
    a = []
    for key in d:
        value = d[key]
        if value not in a:
            q[value] = key
            a.append(value)
    return q


def swap_keys_values(dic):
    d = []
    for key in dic:
        value = dic[key]
        d[value] = key
    return d


def swap_keys_values(d):
    dic = {}
    a = list(d.values())
    b = list(d.keys())
    for i in range(0, len(a)):
        dic[a[i]] = b[i]
    return dic


def swap_unique_keys_values(d):
    q = {}
    a = []
    for key in d:
        value = d[key]
        if value not in a:
            q[value] = key
            a.append(value)
    print(a)
    return q


def swap_keys_values(d):
    dic = {}
    a = list(d.values())
    b = list(d.keys())
    print(a)


def swap_keys_values(d):
    keys = list(d.keys())
    values = list(d.values())
    new = {}
    i = 0
    while i < len(keys):
        new[value[i]] = keys[i]
        i = i + 1
    return new


def swap_keys_values(s):
    new_d = {}
    key = sorted(d.keys())
    value = sorted(d.values())
    for i in range(0, len(key) - 1):
        new_d[key[i]] = value[i]
    return new_d


def swap_unique_keys_values(d):
    opposite = {}
    for k in d:
        if d[k] not in opposite:
            opposite[d[k]] = k
        else:
            del d[k]
    return opposite


def swap_keys_values(d):
    dic = {}
    a = list(d.values())
    b = list(d.keys())
    print((a, 'boop'))


def swap_keys_values(d):
    q = []
    for key in d:
        value = d[key]
        q[value] = key
    return q


def swap_keys_values(d):
    new_d = {}
    key = sorted(d.keys())
    value = sorted(d.values())
    for i in range(0, len(key) - 1):
        new_d[key[i]] = value[i]
    return new_d


def swap_unique_keys_values(d):
    return {t[1]: t[0] for t in list(d.items()) if list(d.values()).count(d
        [1]) == 1}


def swap_keys_values(d):
    new_d = {}
    key = sorted(d.keys())
    value = sorted(d.values())
    for i in range(0, len(key)):
        new_d[value[i]] = key[i]
    return new_d


def swap_keys_values(d):
    e = {}
    for d_tup in list(d.items()):
        e[d_tup[1]] = d_tup[0]
    return e


def swap_keys_values(d):
    dic = {}
    for key in d:
        dic[d[key]] = key
    return dic


def swap_unique_keys_values(d):
    opposite = {}
    for k in d:
        if k not in opposite:
            opposite[d[k]] = k
        else:
            del d[k]
    return opposite


def swap_keys_values(d):
    keys = list(d.keys())
    values = list(d.values())
    new = {}
    i = 0
    while i < len(keys):
        val = value[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    return {t[1]: t[0] for t in list(d.items()) if list(d.values()).count(t
        [1]) == 1}


def swap_keys_values(d):
    keys = list(d.keys())
    values = list(d.values())
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    q = {}
    a = []
    b = []
    for key in d:
        value = d[key]
        if value not in a:
            a.append(value)
        else:
            b.append(value)
    for key in d:
        value = d[key]
        if value not in b:
            q[value] = key
            a.append(value)
    return q


def swap_keys_values(d):
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    return dic


def swap_unique_keys_values(d):
    opposite = {}
    for k in d:
        if k not in opposite:
            opposite[d[k]] = k
        else:
            del opposite[k]
    return opposite


def swap_unique_keys_values(d):
    opposite = {}
    for k in d:
        if k not in opposite:
            opposite[d[k]] = k
        elif k in opposite:
            del opposite[k]
    return opposite


def swap_unique_keys_values(dick):
    newDick = {}
    deleted = []
    for item in dick:
        if dick[item] not in newDick:
            newDick[dick[item]] = item
        else:
            deleted.append(dick[item])
    print(deleted)


def swap_keys_values(in_dict):
    out_dict = {}
    for k, v in list(in_dict.items()):
        out_dict[v] = k
    return out_dict


def swap_keys_values():
    new_dict = {}
    for key in d:
        new_dict[d[key]] = key
    return new_dict


def swap_keys_values(d):
    new_dict = {}
    for key in d:
        new_dict[d[key]] = key
    return new_dict


def swap_unique_keys_values(dick):
    newDick = {}
    deleted = []
    for item in dick:
        if dick[item] not in newDick:
            newDick[dick[item]] = item
        else:
            deleted.append(dick[item])
    print(deleted)
    for item in deleted:
        del newDick[item]


def swap_keys_values(d):
    new_d = {}
    for k, v in list(d.items()):
        new_d[v] = k
    return new_d


def swap_keys_values(dict_in):
    new_dict = {}
    for k, v in list(dict_in.items()):
        new_dict[v] = k
    return new_dict


def swap_unique_keys_values(d):
    e = {}
    for d_tup in list(d.items()):
        if d.values.count(d_tup[1]) == 1:
            e[d_tup[1]] = d_tup[0]
    return e


def swap_unique_keys_values(d):
    e = {}
    for d_tup in list(d.items()):
        if list(d.values()).count(d_tup[1]) == 1:
            e[d_tup[1]] = d_tup[0]
    return e


def swap_unique_keys_values(dick):
    newDick = {}
    deleted = []
    for item in dick:
        if dick[item] not in newDick:
            newDick[dick[item]] = item
        else:
            deleted.append(dick[item])
    for item in deleted:
        del newDick[item]


def swap_unique_keys_values(dick):
    newDick = {}
    deleted = []
    for item in dick:
        if dick[item] not in newDick:
            newDick[dick[item]] = item
        else:
            deleted.append(dick[item])
    for item in deleted:
        del newDick[item]
    print(newDick)


def swap_unique_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        if file in a:
            a.pop(a.index(dic[file]))
        else:
            a.append([file, dic[file]])
        print(a)
    for letter in a:
        print(letter)
        if letter[1] in c:
            del c[letter[1]]
        else:
            c[letter[1]] = letter[0]
    print(c)
    return c


def swap_unique_keys_values(dick):
    newDick = {}
    deleted = []
    for item in dick:
        if dick[item] not in newDick:
            newDick[dick[item]] = item
        else:
            deleted.append(dick[item])
    for item in deleted:
        del newDick[item]
    return newDick


def swap_unique_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        if file in a:
            a.pop(a.index(dic[file]))
        else:
            a.append([file, dic[file]])
    for letter in a:
        print(letter)
        if letter[1] in c:
            del c[letter[1]]
        else:
            c[letter[1]] = letter[0]
    return c


def swap_unique_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        if file in a:
            a.pop(a.index(dic[file]))
        else:
            a.append([file, dic[file]])
    for letter in a:
        if letter[1] in c:
            del c[letter[1]]
        else:
            c[letter[1]] = letter[0]
    return c


def swap_unique_keys_values(dic):
    a, b, c = [], [], {}
    for file in dic:
        a.append([file, dic[file]])
    for letter in a:
        if letter[1] in c:
            del c[letter[1]]
        else:
            c[letter[1]] = letter[0]
    return c


def swap_keys_values(d):
    new_dict = {}
    old = sorted(d.items())
    for pair in old:
        new_dict[pair[1]] = pair[0]
    return new_dict


def swap_unique_keys_values(d):
    new_dict = {}
    for key in d:
        if d[key] not in new_dict:
            new_dict[d[key]] = key
        else:
            del new_dict[d[key]]
    return new_dict


def swap_unique_keys_values(in_dict):
    dict_out = {}
    not_unique = set()
    for k, v in list(in_dict.items()):
        if v in dict_out:
            not_unique.update([v])
            del dict_out[v]
        elif v not in not_unique:
            dict_out[v] = k
    return dict_out


def swap_unique_keys_values(d):
    new_dict = {}
    old = sorted(d.items())
    for pair in old:
        if pair[1] not in new_dict:
            new_dict[pair[1]] = pair[0]
    return new_dict


def swap_unique_keys_values(d):
    unique = []
    for k in d:
        if d[k] not in unique:
            unique.append(d[k])
        elif d[k] in unique:
            unique.remove(d[k])
    opposite = {}
    for k in d:
        if k in unique:
            opposite[d[k]] = k
    return opposite


def swap_unique_keys_values(d):
    new_d = {}
    for k, v in list(d.items()):
        new_d[v] = k
    return new_d


def swap_unique_keys_values(d):
    unique = []
    for k in d:
        if d[k] not in unique:
            unique.append(d[k])
        elif d[k] in unique:
            unique.remove(d[k])
    opposite = {}
    for k in d:
        if d[k] in unique:
            opposite[d[k]] = k
    return opposite


def swap_keys_values(dictionary):
    new_dictionary = {}
    for key in dictionary:
        new_dictionary[dictionary[key]] = key
    return new_dictionary


def swap_unique_keys_values(d):
    new_d = {}
    unique = set()
    for k, v in list(d.items()):
        if v in new_d:
            unique.update([v])
            del new_d[v]
        else:
            new_d[v] = k
    return new_d


def swap_unique_keys_values(d):
    new_dict = {}
    old = sorted(d.items())
    for pair in old:
        if pair[1] not in new_dict:
            new_dict[pair[1]] = pair[0]
        else:
            del new_dict[pair[1]]
    return new_dict


def swap_unique_keys_values(in_dict):
    dict_out = {}
    not_unique = set()
    for k, v in list(in_dict.items()):
        if v in dict_out:
            not_unique.update([v])
            del dict_out[v]
        else:
            dict_out[v] = k
    return dict_out


def swap_keys_values(d):
    return {v: k for k, v in list(d.items())}


def swap_unique_keys_values(d):
    new_dict = {}
    for k in d:
        v = d.get(k)
        if v in new_dict:
            del new_dict[v]
        else:
            new_dict[v] = k
    return new_dict


def swap_unique_keys_values(d):
    keys = list(d.keys())
    values = list(d.values())
    newD = {}
    for i in range(len(keys)):
        if values.count(values[i]) == 1:
            newD[keys[i]] = values[i]
    return newD


def swap_unique_keys_values(d):
    keys = list(d.keys())
    values = list(d.values())
    newD = {}
    for i in range(len(keys)):
        if values.count(values[i]) == 1:
            newD[values[i]] = keys[i]
    return newD


def swap_keys_values():
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    return newd


def swap_keys_values():
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    print(newd)


def swap_keys_values(d):
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    print(newd)


def swap_keys_values():
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    print(list(newd.items()))


def swap_keys_values(d):
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    print(list(newd.items()))


def swap_keys_values(d):
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    sort = sorted(list(newd.items()), key=lambda x: x[1])
    print(sort)


def swap_keys_values(d):
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    sort = sorted(list(newd.items()), key=lambda x: x[1])
    return sort


def swap_unique_keys_values(d):
    dic = {}
    values = []
    notunique = []
    for key in d:
        if d[key] in values:
            notunique.append(d[key])
        else:
            values.append(d[key])
    for key in d:
        if not d[key] in notunique:
            dic[d[key]] = key
    return dic


def swap_keys_values(d):
    new_d = {}
    for k, v in zip(d):
        new_d[v] = k
    return new_d


def swap_keys_values(d):
    new_d = {}
    for k, v in list(d.items()):
        new_d[v] = k
    return new_d


def swap_keys_values(d):
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    newd = sorted(list(newd.items()), key=lambda x: x[1])
    return newd


def swap_keys_values(d):
    keys = []
    values = []
    newd = {}
    for word in d:
        keys.append(word)
    for word in d:
        values.append(d[word])
    for i in range(0, len(values)):
        newd[values[i]] = keys[i]
    return newd


def swap_keys_values(d):
    swappedDict = {}
    for i in d:
        swappedDict[d[i]] = i
    return swappedDict


def swap_keys_values(d):
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    new_dic = {}
    for key in dic:
        if key not in new_dic:
            new_dic[key] = key
    return new_dic


def swap_unique_keys_values(d):
    swappedDict = {}
    for i in d:
        if d[i] in swappedDict:
            del swappedDict[d[i]]
        else:
            swappedDict[d[i]] = i
    return swappedDict


def swap_unique_keys_values(d):
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    new_dic = {}
    for key in dic:
        if key not in new_dic:
            new_dic[key] = value
    return new_dic


def swap_unique_keys_values(d):
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    new_dic = {}
    for key in dic:
        new_dic[key] = value
    return new_dic


def swap_unique_keys_values(d):
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    new_dic = {}
    for key in dic:
        new_dic[key] = dic[key]
    return new_dic


def swap_unique_keys_values(d):
    val = list(d.values())
    for char in val:
        if count(char) > 1:
            del val[char]
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    new_dic = {}


def swap_unique_keys_values(d):
    val = list(d.values())
    for char in val:
        if char.count() > 1:
            del val[char]
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    new_dic = {}


def swap_keys_values(d):
    new_d = {}
    for k, v in d:
        d1[v] = k
    return new_d


def swap_keys_values(d):
    new_d = {}
    for k in d:
        d1[d[k]] = k
    return new_d


def swap_keys_values(d):
    new_d = {}
    for k in d:
        new_d[d[k]] = k
    return new_d


def swap_unique_keys_values(d):
    l = []
    new_d = {}
    for k in d:
        if d[k] not in l:
            new_d[d[k]] = k
            l.append(d[k])
    return new_d


def merge_lists(l1, l2):
    i = 1
    while i < len(l1):
        del l1[i]
    i = i + 1
    i = 1
    while i < len(l2):
        del l2[i]
    i = i + 1
    print(l1 + l2)


def merge_lists(l1, l2):
    i = 1
    while i < len(l1):
        del l1[i]
    i = i + 1
    j = 1
    while i < len(l2):
        del l2[j]
    j = j + 1
    return l1 + l2


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l3.append(l1[i])
    i = i + 2
    j = 0
    while j < len(l2):
        l4.append(l2[j])
    j = j + 2
    print(l3 + l4)


def merge_lists(l1, l2):
    i = 0
    while i < len(l1):
        l1.append(l1[i])
    i = i + 2
    j = 0
    while j < len(l2):
        l2.append(l2[j])
    j = j + 2
    print(l1 + l2)


def merge_lists(l1, l2):
    l3 = l1 + l2
    a = []
    i = 0
    while i < len(l3):
        a.append(l3[i])
        i = i + 2
    return a


def merge_lists(l1, l2):
    a = []
    i = 0
    while i < len(l1):
        a.append(l1[i])
        i = i + 2
    j = 0
    while j < len(l2):
        a.append(l2[j])
        j = j + 2
    return a


def merge_lists(l1, l2):
    newlist = []
    i = 0
    while i < len(l1):
        newlist.append(l1[i])
        i = i + 2
    j = 0
    while j < len(l2):
        newlist.append(l2[j])
        j = j + 2
    return newlist


def swap_keys_values(d):
    pairs = list(d.items())
    new_d = {}
    for key, value in pairs:
        new_d[value] = key
    return new_d


def swap_keys_values(d):
    new_d = {}
    for k, v in list(d.items()):
        new_d[v] = k
    return new_d


def swap_unique_keys_values(d):
    new_d = {}
    for k, v in list(d.items()):
        if list(d.values()).count(v) == 1:
            new_d[v] = k
    return new_d


def swap_keys_values(d):
    new_dict = {}
    for k, v in (list(d.keys()), list(d.values())):
        new_dict[v] = k
    return new_dict


def swap_keys_values(d):
    new_dict = {}
    for k, v in list(d.items()):
        new_dict[v] = k
    return new_dict


def swap_unique_keys_values(d):
    new_dict = {}
    for k, v in list(d.items()):
        if v not in new_dict:
            new_dict[v] = k
    return new_dict


def swap_keys_values(d):
    nd = {}
    for k, v in list(d.items()):
        nd[v] = k
    return nd


def swap_unique_keys_values(d):
    new_dict = {}
    counter = {}
    for v in list(d.values()):
        if v not in counter:
            counter[v] = 0
        counter[v] += 1
    for k, v in list(d.items()):
        if counter[v] < 2:
            new_dict[v] = k
    return new_dict


def remove_zeros(list):
    i = 0
    while i < len(list):
        if 0 in list:
            list.remove(0)
        i = i + 1


def merge_lists(l1, l2):
    l3 = []
    i = 0
    while i < len(l1):
        if i % 2 == 0:
            l3.append(l1[i])
        i = i + 1
    j = 0
    while j < len(l2):
        if j % 2 == 0:
            l3.append(l2[j])
        j = j + 1
    return l3


def weird_case(some_str):
    new_str = ''
    for value in some_str:
        if value == ' ':
            new_str = new_str + value
        elif value is True:
            new_str = new_str + value.upper()
        else:
            new_str = new_str + value
    return new_str


def weird_case(some_str):
    new_str = ''
    capital = True
    for value in some_str:
        if value == ' ':
            new_str = new_str + value
        elif value is capital:
            new_str = new_str + value.upper()
        else:
            new_str = new_str + value
        capital = not capital
    return new_str


def weird_case(some_str):
    new_str = ''
    capital = True
    for value in some_str:
        if capital:
            new_str = new_str + value.upper()
        else:
            new_str = new_str + value
        if value != ' ':
            capital = not capital
    return new_str


def swap_unique_keys_values(d):
    nd = {}
    to_delete = []
    for k, v in list(d.items()):
        if v in nd:
            to_delete.append(v)
        else:
            nd[v] = k
    for k in to_delete:
        del nd[k]
    return nd


def swap_keys_values(dictionary_descriptor):
    new_dictionary = {}
    for keys, values in dictionary_descriptor:
        new_dictionary[values] = keys


def swap_keys_values(dictionary_descriptor):
    new_dictionary = {}
    for keys, values in list(dictionary_descriptor.items()):
        new_dictionary[values] = keys


def swap_keys_values(dictionary_descriptor):
    new_dictionary = {}
    for keys, values in list(dictionary_descriptor.items()):
        new_dictionary[values] = keys
    return new_dictionary


def swap_unique_keys_values(dictionary_descriptor):
    new_dictionary = {}
    for keys, values in list(dictionary_descriptor.items()):
        try:
            new_dictionary[values] = keys
        except KeyError:
            pass
    return new_dictionary


def swap_unique_keys_values(dictionary_descriptor):
    new_dictionary = {}
    addthese = set()
    for keys, values in list(dictionary_descriptor.items()):
        addthese.update(values, keys)
        new_dictionary[addthese[values]] = addthese[keys]
    return new_dictionary


def swap_unique_keys_values(dictionary_descriptor):
    new_dictionary = {}
    addthese = set()
    for keys, values in list(dictionary_descriptor.items()):
        if values in new_dictionary:
            addthese.update(values)
            del new_dictionary[values]
        else:
            new_dictionary[values] = keys
    return new_dictionary


def swap_unique_keys_values(dictionary_descriptor):
    new_dictionary = {}
    addthese = set()
    for keys, values in list(dictionary_descriptor.items()):
        if values in new_dictionary:
            addthese.update(values)
            del new_dictionary[values]
        elif values not in new_dictionary:
            new_dictionary[values] = keys
    return new_dictionary


def swap_unique_keys_values(dictionary_descriptor):
    new_dictionary = {}
    addthese = set()
    for keys, values in list(dictionary_descriptor.items()):
        if values in new_dictionary:
            addthese.update([values])
            del new_dictionary[values]
        elif values not in new_dictionary:
            new_dictionary[values] = keys
    return new_dictionary


def swap_unique_keys_values(d):
    vals = list(d.values())
    return {v: k for k, v in list(d.items()) if vals.count(v) == 1}


def swap_keys_values(d):
    return {v: k for k, v in list(d.items())}


def swap_keys_values(dic):
    return {val: key for key, val in list(dic.items())}


def swap_unique_keys_values(dic):
    new_dic = {}
    add = set()
    for keys, values in list(dic.items()):
        if values in new_dic:
            add.update([values])
            del new_dic[values]
        elif values not in new_dic:
            new_dic[values] = keys
    return new_dic


def swap_keys_values(d):
    newd = {}
    for k in d:
        newd[d[k]] = k
    return newd


def unique_key_values(d):
    unique_d = {}
    for k in d:
        if is_unique(d[k], d):
            unique_d[k] = d[k]
    return unique_d

def swap_unique_keys_values(d):
    d = unique_key_values(d)
    print(d)
    newd = {}
    for k in d:
        newd[d[k]] = k
    return newd


def unique_key_values(d):
    unique_d = {}
    for k in d:
        if is_unique(d[k], d):
            unique_d[k] = d[k]
    return unique_d

def swap_unique_keys_values(d):
    d = unique_key_values(d)
    newd = {}
    for k in d:
        newd[d[k]] = k
    return newd


def swap_keys_values(my_dict):
    new_dict = {y: x for x, y in list(my_dict.items())}
    return new_dict


def merge_lists(l1, l2):
    i = 0
    l3 = l1[i + 1] + l2[i + 1]
    return l3


def merge_lists(l1, l2):
    i = 0
    l3 = l1[i] + 1 + (l2[i] + 1)
    return l3


def merge_lists(l1, l2):
    i = 0
    l3 = l1[::2] + l2[::2]
    return l3


def weird_case(some_str):
    return some_str.upper()[::2]


def weird_case(some_str):
    return some_str.upper()[::2], some_str.lower()[::1]


def weird_case(some_str):
    return some_str[0].upper() + some_str[1].lower()


def weird_case(some_str):
    return some_str[::2].upper() + some_str[::1].lower()


def weird_case(some_str):
    i = True
    letter = ''
    for char in some_str:
        if i:
            letter = leter + char.upper()
        else:
            letter = letter + char.lower()
    return letter


def weird_case(some_str):
    i = True
    letter = ''
    for char in some_str:
        if i:
            letter = letter + char.upper()
        else:
            letter = letter + char.lower()
    return letter


def weird_case(some_str):
    i = True
    letter = ''
    for char in some_str:
        if i:
            letter = letter + char.upper()
        else:
            letter = letter + char.lower()
        if char != ' ':
            i = False
    return letter


def weird_case(some_str):
    i = True
    letter = ''
    for char in some_str:
        if i:
            letter = letter + char.upper()
        else:
            letter = letter + char.lower()
        if char != ' ':
            i = not i
    return letter


def remove_zeros(list):
    return list.remove('0')


def remove_zeros(list):
    if '0' in list:
        return list.remove('0')
    else:
        return list


def remove_zeros(list):
    if '0' in list:
        return list.pop('0')
    else:
        return list


def remove_zeros(list):
    if '0' in list:
        print(list.remove('0'))
    else:
        print(list)


def remove_zeros(list):
    for number in list:
        if '0' in list:
            return list.remove('0')
        else:
            return list


def swap_keys_values(d):
    return {v: k for k, v in list(d.items())}


def swap_unique_keys_values(d):
    new_dict = {}
    for k in d:
        v = d.get(k)
        if v in new_dict:
            del new_dict[v]
        else:
            new_dict[v] = k
    return new_dict


def swap_unique_keys_values(d):
    oldvalues = [v for v in list(d.values())]
    oldkeys = [k for k in list(d.keys())]
    counts = {}
    for v in oldvalues:
        if v not in counts:
            counts[v] = 1
        else:
            counts[v] += 1
    unique = []
    for v in counts:
        if counts[v] == 1:
            unique.append(v)
    reverseddic = {}
    for i in range(0, len(oldvalues)):
        reverseddic[oldvalues[i]] = oldkeys[i]
    newdic = {}
    for k, v in list(reverseddic.items()):
        if k in unique:
            newdic[k] = v
    return newdic


def swap_keys_values(dict):
    new_dict = {v: k for k, v in list(dict.items())}
    return new_dict


def swap_unique_keys_values(dict):
    new_dict = {v: k for k, v in list(dict.items())}
    return new_dict


def swap_unique_keys_values(dict):
    for k in dict:
        print(k)
    new_dict = {v: k for k, v in list(dict.items())}
    return new_dict


def swap_unique_keys_values(dict):
    for k, v in list(dict.items()):
        print(v)
    new_dict = {v: k for k, v in list(dict.items())}
    return new_dict


def swap_unique_keys_values(dict):
    dict1 = {}
    a = []
    for k, v in list(dict.items()):
        a.append(v)
    for k, v in list(dict.items()):
        if a.count('v') == 1:
            dict1[k] = v
    new_dict = {v: k for k, v in list(dict1.items())}
    return new_dict


def swap_unique_keys_values(dict):
    dict1 = {}
    a = []
    for k, v in list(dict.items()):
        a.append(v)
    print(a)
    for k, v in list(dict.items()):
        if a.count('v') == 1:
            dict1[k] = v
    print(dict1)
    new_dict = {v: k for k, v in list(dict1.items())}
    return new_dict


def swap_unique_keys_values(dict):
    dict1 = {}
    a = []
    for k, v in list(dict.items()):
        a.append(v)
    print(a)
    for k, v in list(dict.items()):
        print(a.count('v'))
    new_dict = {v: k for k, v in list(dict1.items())}
    return new_dict


def swap_unique_keys_values(dict):
    dict1 = {}
    a = []
    for k, v in list(dict.items()):
        a.append(v)
    for k, v in list(dict.items()):
        if a.count(v) == 1:
            dict1[k] = v
    new_dict = {v: k for k, v in list(dict1.items())}
    return new_dict


def merge_lists(l1, l2):
    i = 0
    merging1 = l1.append[i]
    i = i + 2
    j = 0
    merging2 = l2.append[i]
    j = j + 2
    mergedlist = merging1 + merging2
    return mergedlist


def merge_lists(l1, l2):
    i = 0
    merging1 = l1[i]
    i = i + 2
    j = 0
    merging2 = l2[i]
    j = j + 2
    mergedlist = merging1 + merging2
    return mergedlist


def merge_lists(l1, l2):
    i = 0
    merging1 = l1[i]
    i = i + 2
    j = 0
    merging2 = l2[i]
    j = j + 2
    mergedlist = merging1 + merging2
    return merging1


def merge_lists(l1, l2):
    i = 0
    merging1 = l1[i]
    i = i + 2
    j = 0
    merging2 = l2[j]
    j = j + 2
    mergedlist = merging1 + merging2
    return mergedlist


def weird_case(some_str):
    ret = ''
    i = True
    for char in some_str:
        if i:
            ret += char.upper()
        else:
            ret += char.lower()
        if char != ' ':
            i = not i
    return ret


def remove_zeros(list, val):
    for i in range(list.count(val)):
        list.remove(val)


def merge_lists(n, m):
    i = 0
    while i < len(m):
        n.append(m[i])
        i = i + 1
    i = 0
    while i < len(n):
        if i % 2 == 1 and i != 0:
            n.remove(n[i])
        i = i + 1
    return n


def weird_case(n):
    a = []
    line = n.strip('\n').split(' ')
    i = 0
    while i < len(line):
        word = line[i]
        x = 0
        while x < len(word):
            a.append(word[x])
            x = x + 1
        a.append(' ')
        i = i + 1
    a.remove(a[len(a) - 1])
    print(a)


def swap_unique_keys_values(my_dict):
    seen = []
    unseen = []
    for key in list(my_dict.keys()):
        value = my_dict[key]
        if value in seen:
            unseen.append(value)
        else:
            seen.append(value)
    new_dict = {k: v for k, v in list(my_dict.items()) if v not in unseen}
    new_dict = {y: x for x, y in list(new_dict.items())}
    return new_dict


def swap_unique_keys_values(my_dict):
    seen = []
    unseen = []
    for key in list(my_dict.keys()):
        value = my_dict[key]
        if value in seen:
            unseen.append(value)
        else:
            seen.append(value)
    new_dict = {v: k for k, v in list(my_dict.items()) if v not in unseen}
    return new_dict


def swap_keys_values(my_dict):
    new_dict = {v: k for k, v in list(my_dict.items())}
    return new_dict


def swap_unique_keys_values(my_dict):
    seen = []
    unseen = []
    for key in list(my_dict.keys()):
        value = my_dict[key]
        if value in unseen:
            seen.append(value)
        else:
            unseen.append(value)
    new_dict = {v: k for k, v in list(my_dict.items()) if v not in seen}
    return new_dict


def swap_keys_values(d):
    for k, v in list(d.items()):
        del d[k]
        d[v] = k


def swap_unique_keys_values(dictionary):
    values = []
    new_dict = {}
    for key in dictionary:
        values.append(dictionary[key])
    for key, value in list(dictionary.items()):
        if values.count(value) == 1:
            new_dict[value] = key
    return new_dict


def swap_keys_values(original_dict):
    swapped_dict = {}
    for key in original_dict:
        swapped_dict[original_dict[key]] = key
    return swapped_dict


def swap_unique_keys_values(dic):
    unique_dict = {}
    for key in dic:
        if list(dic.values()).count(dic[key]) == 1:
            unique_dict[dic[key]] = key
    return unique_dict


def swap_unique_keys_values(dic):
    dic = {'a': 4, 'b': 7, 'c': 10, 'd': 7}
    list_of_values = [dic[value] for value in dic]
    unique_dict = {}
    for key in dic:
        if list_of_values.count(dic[key]) == 1:
            unique_dict[dic[key]] = key
    return unique_dict


def swap_keys_values(d):
    a = {}
    for k, v in list(d.items()):
        a[v] = k
    return a


def swap_keys_values(d):
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    return d


def swap_keys_values(d):
    dic = {}
    for key in d:
        value = d[key]
        dic[value] = key
    return dic


def swap_keys_values(d):
    new_dict = {}
    i = 0
    while i < len(d):
        new_dict[d[0]] = d[1]
        i += 1
    return new_dict


def swap_keys_values(d):
    print(d)
    new_dict = {}
    i = 0
    while i < len(d):
        new_dict[d[i]] = d[0]
        i += 1
    return new_dict


def swap_keys_values(d):
    print(d)
    new_dict = {}
    print(list(d.keys()))
    print(list(d.items()))
    print(list(d.values()))
    for k, v in list(d.items()):
        new_dict[v] = k
    return new_dict


def swap_keys_values(d):
    new_dict = {}
    for k, v in list(d.items()):
        new_dict[v] = k
    return new_dict


def swap_unique_keys_values(d):
    new_d = {}
    for k, v in list(d.items()):
        if v not in new_d:
            new_d[v] = k
        else:
            del new_d[v]
    return new_d


def swap_keys_values(d):
    keys = []
    values = []
    for key in d:
        keys.append(key)
        values.append(d[key])
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    keys = []
    values = []
    for key in d:
        if d[key] not in values:
            keys.append(key)
            values.append(d[key])
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    keys = []
    values = []
    for key in d:
        if d.count(d[key]) == 1:
            keys.append(key)
            values.append(d[key])
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    keys = []
    values = []
    for key in d:
        values.append(d[key])
    for key in d:
        if d.count(values) == 1:
            keys.append(key)
            values.append(d[key])
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    keys = []
    values = []
    for key in d:
        values.append(d[key])
    print(values)
    for key in d:
        if d.count(values) == 1:
            keys.append(key)
            values.append(d[key])
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    keys = []
    values = []
    for key in d:
        values.append(d[key])
    for key in d:
        if values.count(d[key]) == 1:
            keys.append(key)
            values.append(d[key])
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    keys = []
    values = []
    i = 0
    while i < len(d):
        values.append(d[key])
    for key in d:
        if values.count(d[key]) == 1:
            keys.append(key)
            values.append(d[key])
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    keys = []
    values = []
    i = 0
    while i < len(d):
        values.append(d[i])
    for key in d:
        if values.count(d[key]) == 1:
            keys.append(key)
            values.append(d[key])
    new = {}
    i = 0
    while i < len(keys):
        val = values[i]
        key = keys[i]
        new[val] = key
        i = i + 1
    return new


def swap_unique_keys_values(d):
    pairs = list(d.items())
    new_d = {}
    for key, value in pairs:
        if not value in new_d:
            new_d[value] = key
        else:
            del new_d[value]
    return new_d