#include <stdio.h>
int main(void) {
int m[3][4] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
int row;
int col;
int rc;
for(row = 0; row < 3; ++row) {
for(col = 0; col < 4; col++) {
printf("%2d ", m[row][col]);
}
printf("\n");
}
for(rc = 0; rc < 12; rc++) {
printf("%2d ", m[0][rc]);
if((rc+1) % 4 == 0) {
printf("\n");
}
}
for(rc = -4; rc < 8; rc++) {
printf("%2d ", m[1][rc]);
}
printf("\n");
for(rc = -8; rc < 4; rc++) {
printf("%2d ", m[2][rc]);
}
printf("\n");
return 0;
}