def transpose(matrix):
    """return the transpose of a matrix stored as a 9-element tuple"""
    return (matrix[0], matrix[3], matrix[6],
            matrix[1], matrix[4], matrix[7],
            matrix[2], matrix[5], matrix[8])