import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;

class Nov1 {
	public static void main(String[] args) {


		if (args.length == 0) {
			System.out.println("Usage: Nov1 filename");
			return;
		}

		String fileName = args[0];
		System.out.println("using file: " + fileName);

		File f = null;
		Scanner input = null;

		try {
			f = new File(fileName); 
			input = new Scanner(f);
		}
		catch(FileNotFoundException e) {
			e.printStackTrace();
			return;
		}


		input.useDelimiter(",|\n");
	
		int numRows = input.nextInt();
		int numCols = input.nextInt();

		int[][] arr = new int[numRows][numCols];
		
		for(int i = 0; i < numRows; i++) {
			for (int j = 0; j < numCols; j++) {
				arr[i][j] = input.nextInt();
			}
		}

		printArray(arr);	

		input.close();	
	}

	static void printArray(int[][] arr) {
		for(int[] row : arr) {
			for(int elm : row) {
				System.out.print(elm + " ");
			}
			System.out.println();
		}
		System.out.println();
	}
}

// end of file
