public static void Main()
int rows = int.Parse(Console.ReadLine());
int cols = int.Parse(Console.ReadLine());
int[, ] matrix = new int[rows, cols];
for (int row = 0; row < rows; row++)
int[] rowArray = Console.ReadLine().Split ('').Select(int.Parse).ToArray();
for (int col = 0; col < cols; col++)