<filename>6 - Python/Built-Ins/3 - Sort Data.py
N, M = map(int, input().split())
rows, k = [list(map(int, input().split())) for _ in range(N)], int(input())
[print(*row) for row in sorted(rows, key = lambda x: x[k])]

<filename>6 - Python/Built-Ins/3 - Sort Data.py
N, M = map(int, input().split())
rows, k = [list(map(int, input().split())) for _ in range(N)], int(input())
[print(*row) for row in sorted(rows, key = lambda x: x[k])]
