int main() {
    int n, m;
    scanf("%d %d", &n, &m);
    int val[n * m];
    for (int i = 0; i < n * m; i++) {
        scanf("%d ", &val[i]);
        printf("%d ", val[i]);
        if ((i + 1) % m == 0) printf("\n");
    }
    return 0;
}