def tuple_sort_key(values):
    """
    Key for sorting tuples of integer values. First sort according to the first value, then second ...
    :param values: tuple of positive integers
    :return: positive integer that can be used as sort key
    """
    key = 0
    max_value, multi = 100000000, 1
    for value in values[::-1]:
        key += multi + value
        max_value *= multi
    return key