import sys sys.setrecursionlimit(1000000000) # # Solution Template for Yet Another Lights Problem # # Australian Informatics Olympiad 2023 # # This file is provided to assist with reading of input and writing of output # for the problem. You may modify this file however you wish, or # you may choose not to use this file at all. # # R is the number of rows. R = 0 # C is the number of columns. C = 0 # grid contains the initial state of each light. grid = [] # Read the values of R, C and the initial state of each light. R, C = map(int, input().strip().split()) grid = [ input().strip() for i in range(R) ] # TODO: This is where you should compute your solution. # You should append your cross-flips as tuples into the list cross_flips. For # example, to include a cross-flip at position (2, 3), you should do # cross_flips.append((2, 3)). cross_flips = [] # If it is impossible to turn all the lights on, you should set is_impossible # to True. is_impossible = False # Write the answers. if is_impossible: print("-1") else: print(len(cross_flips)) for flip in cross_flips: print(flip[0], flip[1])