# 832

class Solution:
    def flip(self, matrix):

        for row in matrix:
            for i in range((len(row) + 1) // 2):
                row[i], row[-1 -i] = 1 - row[-1 -i], 1 - row[i]
        
        return matrix

solution = Solution()
matrix = [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]]
print(solution.flip(matrix))