Help me in solving DAA008 problem

My issue

give solution for this problem

My code

def cmp(a, b):
    # Complete the function to compare a and b
    pass

def custom_sort(arr):
    n = len(arr)
    for i in range(n):
        for j in range(n - 1):
            if cmp(arr[j], arr[j + 1]):
                arr[j], arr[j + 1] = arr[j + 1], arr[j]

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

    arr = [list(map(int, input().split())) for _ in range(n)]

    custom_sort(arr)

    for i in range(n):
        print(arr[i][0], arr[i][1])


Learning course: Analysis and Design of Algorithms
Problem Link: Comparator Function in Analysis and Design of Algorithms