"""
HackerRank - Diagonal Difference

Input:
3
11 2 4
4 5 6
10 8 -12

Output:
15
"""
import math
import os
import random
import re
import sys


def diagonalDifference(arr):
    # Write your code here
    right = [arr[i][j] for i, j in zip(range(n), range(n))]
    left = [arr[i][j] for i, j in zip(range(n), range(n - 1, -1, -1))]

    return abs(sum(right) - sum(left))


if __name__ == "__main__":
    n = int(input().strip())

    arr = []

    for _ in range(n):
        arr.append(list(map(int, input().rstrip().split())))

    result = diagonalDifference(arr)

    print(result)
3434a0d838c05fa325f06d35d57b40da0a6ce251
<mask token>

<mask token>


def diagonalDifference(arr):
    right = [arr[i][j] for i, j in zip(range(n), range(n))]
    left = [arr[i][j] for i, j in zip(range(n), range(n - 1, -1, -1))]
    return abs(sum(right) - sum(left))


<mask token>

<mask token>


def diagonalDifference(arr):
    right = [arr[i][j] for i, j in zip(range(n), range(n))]
    left = [arr[i][j] for i, j in zip(range(n), range(n - 1, -1, -1))]
    return abs(sum(right) - sum(left))


if __name__ == '__main__':
    n = int(input().strip())
    arr = []
    for _ in range(n):
        arr.append(list(map(int, input().rstrip().split())))
    result = diagonalDifference(arr)
    print(result)

<mask token>
import math
import os
import random
import re
import sys


def diagonalDifference(arr):
    right = [arr[i][j] for i, j in zip(range(n), range(n))]
    left = [arr[i][j] for i, j in zip(range(n), range(n - 1, -1, -1))]
    return abs(sum(right) - sum(left))


if __name__ == '__main__':
    n = int(input().strip())
    arr = []
    for _ in range(n):
        arr.append(list(map(int, input().rstrip().split())))
    result = diagonalDifference(arr)
    print(result)

"""
HackerRank - Diagonal Difference

Input:
3
11 2 4
4 5 6
10 8 -12

Output:
15
"""
import math
import os
import random
import re
import sys


def diagonalDifference(arr):
    # Write your code here
    right = [arr[i][j] for i, j in zip(range(n), range(n))]
    left = [arr[i][j] for i, j in zip(range(n), range(n - 1, -1, -1))]

    return abs(sum(right) - sum(left))


if __name__ == "__main__":
    n = int(input().strip())

    arr = []

    for _ in range(n):
        arr.append(list(map(int, input().rstrip().split())))

    result = diagonalDifference(arr)

    print(result)