Reverse a list of elements.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = 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.


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

Repeatedly move minimimum of remaining sublist to front.


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

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

Reverse a list of elements.


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 reverse(a):
    i = 0
    while i < len(a):
        a[len(a) - i - 1]
        i = i + 1

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

Reverse a list of elements.


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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

Reverse a list of elements.


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

Reverse a list of elements.


def reverse(a):
    i = 0
    j = len(a) - 1

Reverse a list of elements.


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

def reverse(a):
    i = 0
    j = len(a) - 1
    swap(a, i, j)

Reverse a list of elements.


def selection_sort(a):
    i = 0
    while i < len(a):
        j = i + 1
        p = i
        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 reverse(a):
    i = 0
    while i < len(a) / 2:
        tmp = a[i]
        a[i] = a[len(a) - 1 - i]
        a[len(a) - 1 - i] = tmp
        i = i + 1
    return a

Reverse a list of elements.


Reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        print(a[len(a) - i - 1])
        i = i + 1

Reverse a list of elements.


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

Reverse a list of elements.


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


def selection_sort(a):
    p = 0
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if int(a[j]) < int(a[p]):
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        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 reverse(a):
    i = 0
    j = len(a) - 1
    while i < len(a) / 2:
        tmp = a[i]
        a[i] = a[j]
        a[j] = tmp
        i = i + 1
        j = j - 1

Reverse a list of elements.


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

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

Reverse a list of elements.


def reverse(a):
    m = len(a) - i - 1
    return m

Reverse a list of elements.


def reverse(a):
    m = len(a) - i - 1
    return m
    i = i + 1

Reverse a list of elements.


def reverse(a, i):
    while i < len(a):
        return a[len(a) - i - 1]
        i = i + 1

Reverse a list of elements.


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


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


def reverse(a):
    tmp = a[i]
    a[i] = a[len(a) - i - 1]
    a[len(a) - i - 1]
    return a

Reverse a list of elements.


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


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

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


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

Reverse a list of elements.


def selection_sort(a):
    i = 1
    while i < len(a):
        smallest = i
        j = i + 1
        while j < len(a):
            if a[i] < a[smallest]:
                smallest = i
            j = j + 1
        temp = a[i]
        a[i] = a[j]
        a[j] = temp
        i = i + 1


def reverse(a):
    while i < len(a):
        return a[len(a) - i - 1]
        i = i + 1

Reverse a list of elements.


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

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

Reverse a list of elements.


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


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

Reverse a list of elements.


Reverse a list of elements.


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

Reverse a list of elements.


def reverse(a, i):
    i = 0
    while i < len(a):
        return a[len(a) - i - 1]
        i = i + 1

Reverse a list of elements.


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
    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
        i = i + 1
    return a


def selection_sort(a):
    i = 0
    while i < len(a):
        smallest = i
        j = i + 1
        while j < len(a):
            if a[j] < a[smallest]:
                smallest = j
            j = j + 1
        temp = a[smallest]
        a[smallest] = a[i]
        a[i] = temp
        i = i + 1


def reverse(a):
    i = 0
    m = len(a) - i - 1
    i = i + 1
    return m

Reverse a list of elements.


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

def reverse(a):
    swap(a, i, j)
    a[len(a) - i - 1]

Reverse a list of elements.


def selection_sort(a):
    c = 0
    while c < len(a):
        i = c + 1
        p = c
        while i < len(a):
            if a[p] > a[i]:
                p = i
            z = a[p]
            a[p] = a[c]
            a[c] = z
            i += 1
        c += 1


def selection_sort(a):
    c = 0
    while c < len(a):
        i = c
        p = c
        while i < len(a):
            if a[p] > a[i]:
                p = i
            z = a[p]
            a[p] = a[c]
            a[c] = z
            i += 1
        c += 1


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 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.


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

Reverse a list of elements.


def selection_sort(a):
    c = 0
    while c < len(a):
        i = c
        p = c
        while i < len(a):
            if a[p] < a[i]:
                p = i
            z = a[p]
            a[p] = a[c]
            a[c] = z
            i += 1
        c += 1


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


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

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

Reverse a list of elements.


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[i]
        a[i] = a[p]
        a[p] = tmp
        i = i + 1
    return a


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


def reverse(a):
    t = ''
    while i < len(a):
        t = a[j] + t
        j = j + 1
        return t

Reverse a list of elements.


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


Reverse a list of elements.


def reverse(a):
    b = []
    i = 0
    while i < len(a):
        b.append(a[len(a) - 1 - i])
        i = i + 1
    return b

Reverse a list of elements.


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

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

Reverse a list of elements.


def selection_sort(a):
    c = 0
    while c < len(a):
        i = c
        p = c
        while i < len(a):
            if a[p] > a[i]:
                p = i
            i += 1
        z = a[p]
        a[p] = a[c]
        a[c] = z
        c += 1


def reverse(a):
    a = a[::-1]
    return a

Reverse a list of elements.


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

def reverse(a):
    swap(a, i, j)
    i = 0
    while i < len(a):
        a[len(a) - i - 1]

Reverse a list of elements.


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

def reverse(a):
    i = 0
    n = len(a) - i - 1
    while n < len(a) - 1:
        if a[j] < a[n]:
            swap(a, i, j)
        n = n + 1

Reverse a list of elements.


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

def reverse(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
    swap(a, i, j)
    i += 1

Reverse a list of elements.


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
    return p


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

def reverse(a):
    swap(a, i, j)
    i = 0
    while i < len(a):
        a[len(a) - i - 1]
    i = i + 1

Reverse a list of elements.


def reverse(a):
    t = ''
    while j < len(a):
        t = a[j] + t
        j = j + 1
        return t

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def reverse(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
        swap(a, i, j)
        i += 1

Reverse a list of elements.


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

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

Reverse a list of elements.


def reverse(a):
    t = ''
    while j < len(i):
        t = a[j] + t
        j = j + 1
        return a

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest(a, i)
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


Reverse a list of elements.


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

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

Reverse a list of elements.


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

def reverse(a):
    swap(a, i, j)
    i = 0
    while i < len(a):
        x = a[len(a) - i - 1]

Reverse a list of elements.


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


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

def reverse(a):
    swap(a, i, j)

Reverse a list of elements.


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


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def reverse(a):
    swap(a, i, j)

Reverse a list of elements.


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

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

Reverse a list of elements.


def smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest(a, i)
        swap(a, i, p)
        i = i + 1
    return a


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


def reverse(a):
    m = len(a) - i - 1
    return m

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def reverse(a):
    i = 0
    j = a[len(a - i - 1)]
    swap(a, 0, j)
    i = i + 1

Reverse a list of elements.


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

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

Reverse a list of elements.


Reverse a list of elements.


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


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

def reverse(a):
    i = 0
    while i < len(a):
        swap(a, 4, 1)
        swap(a, 3, 2)
        i = i + 1

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def reverse(a):
    i = 0
    j = int(a[len(a - i - 1)])
    swap(a, 0, j)
    i = i + 1

Reverse a list of elements.


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


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

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

Reverse a list of elements.


def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


def reverse(a):
    x = len(a) - i - 1
    return x

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def reverse(a):
    i = 0
    j = int(a[len(a) - i - 1])
    swap(a, 0, j)
    i = i + 1

Reverse a list of elements.


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

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

Reverse a list of elements.


def reverse(a):
    t = ''
    while j < len(i):
        t = a[j] + t
        j = j + 1
        return a

Reverse a list of elements.


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 swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


Reverse a list of elements.


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

def reverse(a):
    i = a[0]
    j = len(a) - 1
    while i < j:
        a = swap(a)
    i = i + 1
    j = j - 1

Reverse a list of elements.


def reverse(a):
    t = ''
    while j < len(i):
        t = a[j] + t
        j = j + 1
        return t

Reverse a list of elements.


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

def reverse(a):
    i = 0
    while i < len(a):
        swap(a, a[i], a[len(a) - i - 1])
        i = i + 1

Reverse a list of elements.


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

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

Reverse a list of elements.


def reverse(a):
    while j < len(a):
        if a[j] > a[p]:
            p = j
        j = j + 1

Reverse a list of elements.


def swap(a, x, y):
    tmp = a[x]
    a[x] = a[y]
    a[y] = tmp
    return a

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

Reverse a list of elements.


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

def reverse(a):
    i = 0
    j = int(a[len(a) - i - 1])
    swap(a, i, j)
    i = i + 1

Reverse a list of elements.


def reverse(a):
    tmp = a[i]
    a[i] = [len(a) - i - 1]
    a[len(a) - i - 1] = tmp
    return a

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            p = j
        j = j + 1
    swap(a, i, p)
    i = i + 1


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

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

Reverse a list of elements.


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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def reverse(a):
    i = 0
    while i < len(a) - 1:
        j = i + 1
        p = 0
        while p < len(a[i:]):
            swap(a, i, j)
            p += 1
        i += 1
    return a

Reverse a list of elements.


def selection_sort(a):
    s = input()
    a = []
    while s != 'end':
        a.append(int(s))
        s = input()
    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
    i = 0
    while i < len(a):
        print(a[i])
        i = i + 1


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

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
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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


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

Reverse a list of elements.


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


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

def reverse(a):
    c = a
    while i < len(a):
        swap(c, c[i], c[len(c) - i - 1])
        i = i + 1
    return c

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            p = j
        j = j + 1
    swap(a, i, j)
    i = i + 1


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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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


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

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

Reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        func_reverse.reverse(a)
        i = i + 1

Reverse a list of elements.


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 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 swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp

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

Reverse a list of elements.


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

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
        swap(a, i, p)
        i = i + 1


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 reverse(a):
    i = 0
    while i < len(a) / 2:
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = tmp
        i = i + 1

Reverse a list of elements.


def smallest(a, i):
    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

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest(a, i)
        swap(a, i, j)
        i = i + 1


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

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

Reverse a list of elements.


Reverse a list of elements.


def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        find_smallest_position(a, i)
        swap(a, i, j)
        i = i + 1


def smallest(a, i):
    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
        i = i + 1

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest(a, i)
        swap(a, i, j)
        i = i + 1


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

def reverse(a):
    i = a[0]
    j = len(a) - 1
    while i < j:
        a = swap(a)
        i = i + 1
        j = j - 1

Reverse a list of elements.


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

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

Reverse a list of elements.


def swap(p, i):
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    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 += 1
        swap(p, i)
        i += 1
    return a


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


def swap(a, p, i):
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    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 += 1
        swap(a, p, i)
        i += 1
    return a


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

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

Reverse a list of elements.


Reverse a list of elements.


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

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

Reverse a list of elements.


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


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a, i):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


def smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest(a, i)
        swap(a, i, j)
        i = i + 1


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

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

Reverse a list of elements.


def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


def smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest(a, i)
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


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

def reverse(a):
    i = 0
    j = a[len(a) - 1]
    while i < len(a):
        swap(a, i, j)
        i = i + 1
        j = j - 1

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


Reverse a list of elements.


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

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

Reverse a list of elements.


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

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
        swap(a, p, i)
        i = i + 1
    return p


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

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

Reverse a list of elements.


def smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1

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

def selection_sort(a):
    i = 0
    while i < len(a):
        j = smallest(a, i)
        swap(a, i, j)
        i = i + 1


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

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

Reverse a list of elements.


def selection_sort(a, j, k):
    while i < len(a):
        j = i
        k = i
        while k < len(a):
            if a[j] > a[k]:
                k = j
            k = k + 1
        swap(a, i, j)
        i = i + 1


def swap(a, p, i):
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    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
        swap(a, p, i)
        i = i + 1
    return p


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
        return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i.p)
        i = i + 1


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


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

def reverse(a):
    x = 0
    y = len(a)
    z = len(a) / 2
    while x < y:
        swap(x, y)
        x = x + 1
        y = y - 1

Reverse a list of elements.


def selection_sort(a):
    while i < len(a):
        j = i
        k = i
        while k < len(a):
            if a[j] > a[k]:
                k = j
            k = k + 1
        swap(a, i, j)
        i = i + 1


def smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest(a, i)
        swap(a, i, p)
        i = i + 1


def swap(a, p, i):
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    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
        swap(a, p, i)
        i = i + 1
    return a


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
        return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


def reverse(a):
    return a[len(a) - 1:i]

Reverse a list of elements.


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

def reverse(a):
    x = 0
    y = len(a)
    z = len(a) / 2
    while x < y:
        swap(a, x, y)
        x = x + 1
        y = y - 1

Reverse a list of elements.


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


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


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

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

Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


def find_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j += 1
    return p

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest(a, i)
        swap(a, i, p)
        i += 1


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


Reverse a list of elements.


def selection_sort(a):
    while i < len(a):
        j = i
        k = i
        while k < len(a):
            if a[j] > a[k]:
                k = j
            k = k + 1
        tmp = a[i]
        a[i] = a[j]
        a[j] = tmp
        i = i + 1


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

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

Reverse a list of elements.


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

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
        swap(a, i, p)
        i = i + 1


def selection_sort(a):
    import func_reverse
    i = 0
    while i < len(a):
        j = i
        while j < len(a):
            if a[j] < a[i]:
                swap(a, i, j)
        i = i + 1


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


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


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


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

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

Reverse a list of elements.


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


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


def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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


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

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

Reverse a list of elements.


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 swap(a, i, j):
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp

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

Reverse a list of elements.


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
        print(a[i])
        i = i + 1


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

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

Reverse a list of elements.


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
        print(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
        print(a[i])
        return a


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

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

Reverse a list of elements.


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 reverse(a):
    b = []
    i = 0
    while i < len(a):
        b.append(a[len(a) - 1 - i])
        i = i + 1
    return b

Reverse a list of elements.


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

def reverse(a):
    x = 0
    y = len(a)
    while x < len(a):
        swap(a, x, y)
        x = x + 1
        y = y - 1

Reverse a list of elements.


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

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

Reverse a list of elements.


Reverse a list of elements.


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = p + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        a_tmp = a[p]
        a[p] = a[i]
        a[i] = a_tmp
        i = i + 1
    z = 0
    while z < len(a):
        print(a[z])
        z = z + 1


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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


def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1
        return a


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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


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

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

Reverse a list of elements.


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

def reverse(a):
    i = 0
    j = len(a) - 1
    if a != []:
        while i < 2 % len(a):
            swap(a, i, j)
            j = j - 1
            i = i + 1
        return a
    else:
        return a

Reverse a list of elements.


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

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

Reverse a list of elements.


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 i


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


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

def selection_sort(a):
    i = 0
    while i < len(a):
        j = i
        while j < len(a):
            if a[j] < a[i]:
                swap(a, i, j)
            j = j + 1
        i = i + 1


Reverse a list of elements.


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 += 1
        tmp = a[i]
        a[i] = a[p]
        a[p] = tmp
        i += 1


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
    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


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

Reverse a list of elements.


def selection_sort(a):
    n = input()
    a = []
    while n != 'end':
        a.append(int(n))
        n = input()
    i = 0
    while i < len(a):
        small = i
        j = small + 1
        while j < len(a):
            if a[j] < a[small]:
                small = j
            j += 1
        tmp = a[small]
        a[small] = a[i]
        a[i] = tmp
        i += 1
    i = 0
    while i < len(a):
        print(a[i])
        i += 1


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort():
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


def selection_sort(a):
    while n != 'end':
        a.append(int(n))
        n = input()
    i = 0
    while i < len(a):
        small = i
        j = small + 1
        while j < len(a):
            if a[j] < a[small]:
                small = j
            j += 1
        tmp = a[small]
        a[small] = a[i]
        a[i] = tmp
        i += 1
    i = 0
    while i < len(a):
        print(a[i])
        i += 1


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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


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


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


def selection_sort(a):
    a = a.sorted()


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

Reverse a list of elements.


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


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


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


def reverse(a):
    i = 0
    while i < len(a):
        b.append(a[len(a) - 1 - i])
        i = i + 1
    return b

Reverse a list of elements.


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

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

Reverse a list of elements.


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

Reverse a list of elements.


def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1
        return a


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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


def reverse(a):
    i = 0
    t = []
    while i < len(a):
        t = t + a[len(a) - i - 1]
        i = i + 1
    return t

Reverse a list of elements.


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


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


Reverse a list of elements.


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 swap(a, i, j):
    if a != []:
        tmp = a[i]
        a[i] = a[j]
        a[j] = tmp
        return a
    else:
        return a

def reverse(a):
    i = 0
    j = len(a) - 1
    if a != []:
        while i < 2 % len(a):
            swap(a, i, j)
            j = j - 1
            i = i + 1
        return a
    else:
        return a

Reverse a list of elements.


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 swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return a

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        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 selection_sort(a):
    a = a.sorted()


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


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


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


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


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


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

def reverse(a):
    i = 0
    j = len(a) - 1
    if a != [] and len(a) > 2:
        while i < 2 % len(a):
            swap(a, i, j)
            j = j - 1
            i = i + 1
        return a
    elif len(a) <= 2 and len(a) > 0:
        swap(a, i, j)
        return a
    else:
        return a

Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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


def selection_sort(a):
    i = 0
    while i < len(a):
        p = 0
        j = 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


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
            i = i + 1
        tmp = a[i]
        a[i] = a[p]
        a[p] = tmp
        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
            i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a


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

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

Reverse a list of elements.


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


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 selection_sort(a):
    i = 0
    p = 0
    j = 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
        a[i] = tmp
        a[p] = a[i]
        tmp = a[p]
        i = i + 1
    return a


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

def reverse(a):
    i = 0
    j = len(a) - 1
    if a != [] and len(a) > 2:
        while i < len(a) / 2:
            swap(a, i, j)
            j = j - 1
            i = i + 1
        return a
    elif len(a) <= 2 and len(a) > 0:
        swap(a, i, j)
        return a
    else:
        return a

Reverse a list of elements.


Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1
    return p


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i + 1
        j = p
        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


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        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


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
        temp = a[p]
        a[p] = a[i]
        a[i] = temp
        i = i + 1


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


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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


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

def smallest_position(a):
    smallest = 0
    j = 1
    while j < len(a):
        if a[j] < a[smallest]:
            smallest = j
            j = j + 1
    return smallest

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest_position(a)
        swap(a, i, p)
        i = i + 1


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

def smallest_position(a):
    smallest = 0
    j = 1
    while j < len(a):
        if a[j] < a[smallest]:
            smallest = j
        j = j + 1
    return smallest

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest_position(a)
        swap(a, i, p)
        i = i + 1


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
        a[i] = tmp
        a[p] = a[i]
        tmp = a[p]
        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[i]
        a[i] = a[p]
        a[p] = tmp
        i = i + 1
    return a


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

def smallest_position(a):
    smallest = 0
    j = 1
    while j < len(a):
        if a[j] < a[smallest]:
            smallest = j
        j = j + 1
    return smallest

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest_position(a[i:])
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


Reverse a list of elements.


def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

def reverse(a):
    while i < j:
        swap(a, i, j)
        i = i + 1
        j = j - 1

Reverse a list of elements.


def swap(a, i, j):
    tmp = i
    i = j
    j = tmp

def reverse(a):
    while i < j:
        swap(a, i, j)
        i = i + 1
        j = j - 1

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def lowest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = lowest(a, i)
        swap(a, i, p)
        i += 1


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def reverse(a):
    list(reversed(swap(a)))

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = j + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

def find_smallest_position(a, i):
    p = i
    j = j + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


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


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


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

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


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

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

Reverse a list of elements.


Reverse a list of elements.


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


def reverse(a):
    a = a[::-1]
    return a

Reverse a list of elements.


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

def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1
    return a


def reverse(a):
    i = 0
    while i < len(a):
        b.append(a[len(a) - 1 - i])
        i = i + 1
    return b

Reverse a list of elements.


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

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 += 1
        swap(a, p, i)
        i += 1


def reverse(a):
    b = a[::-1]
    return b

Reverse a list of elements.


def reverse(a):
    a[::-1]
    return a

Reverse a list of elements.


def reverse(a):
    for i in range(0, len(a) / 2):
        a[i], a[len(a) - 1 - i] = a[len(a) - 1 - i], a[i]
    print(a)

Reverse a list of elements.


def reverse(a):
    for i in range(0, len(a) / 2):
        a[i], a[len(a) - 1 - i] = a[len(a) - 1 - i], a[i]

Reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        b.append(a[len(a) - 1 - i])
        i = i + 1
    a = b
    return a

Reverse a list of elements.


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

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

Reverse a list of elements.


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 += 1
        temp = a[i]
        a[i] = a[p]
        a[p] = temp
        i += 1
    return a


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

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

Reverse a list of elements.


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

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

Reverse a list of elements.


def reverse(a):
    print(a[::-1])
    return

Reverse a list of elements.


def reverse(a):
    print(a[::-1])
    return a

Reverse a list of elements.


Reverse a list of elements.


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

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

Reverse a list of elements.


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 swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp

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

Reverse a list of elements.


def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, j)
        swap(a, i, p)
        i = i + 1


def find_smallest_position(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

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

def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


def selection_sort(a):
    i = 0
    while i < len(a):
        p = find_smallest_position(a, i)
        swap(a, i, p)
        i = i + 1


def union(a, b):
    c = []
    ab = a + b
    for i in ab:
        if not i in c:
            c.append(i)
    return c

Merge two lists into a single one.


def intersection(a, b):
    c = []
    for i in a:
        if i in b and not i in c:
            c.append(i)
        return c

Return the elements which are in both lists.


Merge two lists into a single one.


def intersection(a, b):
    c = []
    for i in a:
        if i in b and not i in c:
            c.append(i)
    return c


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):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        swap(a, i, p)
        i = i + 1
    return a

Reverse a list of elements.


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    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
        swap(a, i, p)
        i = i + 1
    return a


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

def reverse(a):
    i = 0
    if a != str():
        while i < len(a):
            p = i
            j = i + 1
            while j < len(a):
                if a[j] < a[p]:
                    p = j
                j = j + 1
            swap(a, i, p)
            i = i + 1
        return a
    if a == str():
        b = []
        i = 0
        while i < len(a):
            b.append(a[len(a) - i - 1])
            print(b)
            i = i + 1

Reverse a list of elements.


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

def reverse(lst):
    i = len(lst) - 1
    for x in range(len(lst) / 2):
        swap(lst, x, i - x)
    return lst

Reverse a list of elements.


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

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

Reverse a list of elements.


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

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_smallest
        swap(a, i, p)
        i = i + 1

assert sort([0])==None and sort([0])==None and sort([])==None and sort([])==None and sort([' '])==None and sort([' '])==None and sort([70, 339305549])==None and sort([70, 339305549])==None


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

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_smallest
        swap(a, i, p)
        i = i + 1
    return p


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

    def find_position_smallest(a, i):
        p = i
        while i < len(a):
            if a[i] < a[p]:
                p = i
            i = i + 1
        return p

        def sort(a):
            i = 0
            while i < len(a):
                p = find_position_smallest
                swap(a, i, p)
                i = i + 1

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_smallest
        swap(a, i, p)
        i = i + 1


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

Search for an element in an array using the binary search algorithm.


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

Reverse a list of elements.


Reverse a list of elements.


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


def reverse(a):
    a.reverse()
    return a

Reverse a list of elements.


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:
        swap(a, i, len(a) - i - 1)
        i += 1
    return a

Reverse a list of elements.


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


def selection_sort(a):
    i = 0
    while i < len(a):
        j = i
        while j < len(a):
            if a[i] > a[j]:
                tmp = a[i]
                a[i] = a[j]
                a[j] = tmp
            j += 1
        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
        else:
            high = mid
            assert q <= a[high]
    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


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


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


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.


Reverse a list of 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

Reverse a list of elements.


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 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[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

Reverse a list of elements.


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

Reverse a list of elements.


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

Reverse a list of elements.


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 swap_keys_values(d):
    return dict([(v, k) for k, v in list(d.items())])

Swap keys with values.


Swap keys with 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 keys with unique values.


Swap keys with unique values.


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

Remove zeros from list.


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

Obtain every second element of l1 and l2.


Remove zeros from list.


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

Remove zeros from list.


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

Remove zeros from list.


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

Remove zeros from list.


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

Remove zeros from list.


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 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 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