var namber = 3;
var namberTwo = namber * namber;
for (var i = 1; i <= namber; i += 1) {
process.stdout.write(i + "\t");
for (var a = i + namber; a <= namberTwo; a += namber) {
if (a <= (namberTwo - namber)) {
process.stdout.write(a + "\t");
} else {
process.stdout.write(a + "\n");
}
}
}
1 4 7
2 5 8
3 6 9
3 2 1
6 5 4
9 8 7