#include <stdio.h>

/*
Use in1.txt and in2.txt as redirected input for this example.
*/

void printEscapeCode(int e);

int main(void){
	//Declare an image array
	int img[100][100];

	//Load in how many rows and columns
	int nRows;
	int nCols;

	scanf("%d %d",&nRows, &nCols);

	//Load in the picture values
	//for every row
	int row, col;
	for(row = 0; row < nRows; row++){
		//for every column
		for(col = 0; col < nCols; col++){
			//read in a value
			int x;
			scanf("%d",&x);
			//store it at the right place
			img[row][col] = x;
		}
	}
	//for every row
	for(row = 0; row < nRows; row++){
                //for every column
                for(col = 0; col < nCols; col++){
                        printEscapeCode(img[row][col]);
                }
		printEscapeCode(7);
		printf("\n");
        }


	return 0;
}

void printEscapeCode(int e){
	printf("\x1b[4%dm  ",e);

}
