def determinant(tup):
    """Calculates the determinant of a tuple (m11, m12, m13, m21, m22, m23, m31, m32, m33)

    Args:
        tup (tuple of ints)

    Returns:
        det (int)
    """
    
    m11, m12, m13, m21, m22, m23, m31, m32, m33 = tup

    det = m11 * m22 * m33 + m12 * m23 * m31 \
        + m13 * m21 * m32 - m11 * m23 * m32 \
        - m12 * m21 * m33 - m13 * m22 * m31

    return det