import random


def shuffle(cards):
    max = len(cards) - 1
    while max != 0:
        r = random.randint(0, max)
        cards[r], cards[max] = cards[max], cards[r]
        max = max - 1
    return cards


def swap(arr, i, j):
    arr[i], arr[j] = arr[j], arr[i]


def qsort(arr, left, right):
    if left >= right:
        return
    swap(arr, left, (left + right) // 2)
    last = left
    i = left + 1
    while i <= right:
        if arr[i] > arr[left]:
            last += 1
            swap(arr, last, i)
        i += 1
    swap(arr, last, left)
    qsort(arr, left, last - 1)
    qsort(arr, last + 1, right)

72dbec79d5deec03fd574ed1c63271ec95ecd54d
<mask token>


def qsort(arr, left, right):
    if left >= right:
        return
    swap(arr, left, (left + right) // 2)
    last = left
    i = left + 1
    while i <= right:
        if arr[i] > arr[left]:
            last += 1
            swap(arr, last, i)
        i += 1
    swap(arr, last, left)
    qsort(arr, left, last - 1)
    qsort(arr, last + 1, right)

<mask token>


def swap(arr, i, j):
    arr[i], arr[j] = arr[j], arr[i]


def qsort(arr, left, right):
    if left >= right:
        return
    swap(arr, left, (left + right) // 2)
    last = left
    i = left + 1
    while i <= right:
        if arr[i] > arr[left]:
            last += 1
            swap(arr, last, i)
        i += 1
    swap(arr, last, left)
    qsort(arr, left, last - 1)
    qsort(arr, last + 1, right)

<mask token>


def shuffle(cards):
    max = len(cards) - 1
    while max != 0:
        r = random.randint(0, max)
        cards[r], cards[max] = cards[max], cards[r]
        max = max - 1
    return cards


def swap(arr, i, j):
    arr[i], arr[j] = arr[j], arr[i]


def qsort(arr, left, right):
    if left >= right:
        return
    swap(arr, left, (left + right) // 2)
    last = left
    i = left + 1
    while i <= right:
        if arr[i] > arr[left]:
            last += 1
            swap(arr, last, i)
        i += 1
    swap(arr, last, left)
    qsort(arr, left, last - 1)
    qsort(arr, last + 1, right)

import random


def shuffle(cards):
    max = len(cards) - 1
    while max != 0:
        r = random.randint(0, max)
        cards[r], cards[max] = cards[max], cards[r]
        max = max - 1
    return cards


def swap(arr, i, j):
    arr[i], arr[j] = arr[j], arr[i]


def qsort(arr, left, right):
    if left >= right:
        return
    swap(arr, left, (left + right) // 2)
    last = left
    i = left + 1
    while i <= right:
        if arr[i] > arr[left]:
            last += 1
            swap(arr, last, i)
        i += 1
    swap(arr, last, left)
    qsort(arr, left, last - 1)
    qsort(arr, last + 1, right)
