def get(matrix, a, b, swap, da=0, db=0):
    """Get value from matrix[a][b] or matrix[b][a], according to swap"""
    # pylint: disable=invalid-name
    # pylint: disable=too-many-arguments
    a, b = swap(a, b)
    return matrix[a + da][b + db]