#include <stdio.h>
#include <stdlib.h>
#include <string.h>



int **make_grid(int rows, int cols) {
    // TODO: implement this function
    (void) rows;
    (void) cols;
    return NULL;
}

void free_grid(int **grid, int rows) {
    // TODO: implement this function
    (void) grid;
    (void) rows;
}


int main(void) {
    int rows, cols;
    if (scanf("%d %d", &rows, &cols) != 2) { return 0; }
    int **grid = make_grid(rows, cols);
    int r, c, val;
    if (scanf("%d %d %d", &r, &c, &val) == 3) { grid[r][c] = val; }
    for (int i = 0; i < rows; i++) {
        for (int j = 0; j < cols; j++) {
            printf("%d", grid[i][j]);
            if (j < cols - 1) { printf(" "); }
        }
        printf("\n");
    }
    free_grid(grid, rows);
    return 0;
}
