Problem: You are given two matrices and . Each matrix contains exactly rows and columns. Each element of is either or ; each element of is initially .
You may perform some operations with matrix . During each operation, you choose any submatrix of having size , and replace every element in the chosen submatrix with . In other words, you choose two integers and such that and , and then set , , and to .
Your goal is to make matrix equal to matrix . Two matrices and are equal if and only if every element of matrix is equal to the corresponding element of matrix .
Is it possible to make these matrices equal? If it is, you have to come up with a sequence of operations that makes equal to . Note that you don't have to minimize the number of operations.
Input Format: The first line contains two integers and ().
Then lines follow, each containing integers. The -th integer in the -th line is . Each integer is either or .
Output Format: If it is impossible to make equal to , print one integer .
Otherwise, print any sequence of operations that transforms into in the following format: the first line should contain one integer — the number of operations, and then lines should follow, each line containing two integers and for the corresponding operation (set , , and to ). The condition should hold.
Note: The sequence of operations in the first example: