//============================================================================
// Name        : [email protected]	H. Multiplication Table
// Author      : LiJunLe
// Version     : Accepted
// Copyright   : http://codeforces.com/contest/39/problem/H
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <stdio.h>
using namespace std;

int toBase(int num, int base) {
	int temp[15];
	int it = 0;
	while(num) {
		temp[it ++] = num % base;
		num /= base;
	}
	int ret = 0;
	while(it > 0) {
		ret = ret * 10 + temp[--it];
	}
	return ret;
}

int main() {
	int n;
	scanf("%d", &n);
	for (int i = 1; i < n; i ++) {
		printf("%d", i);
		for (int j = 2; j < n; j ++) {
			printf("%3d", toBase(i*j, n));
		}
		puts("");
	}
	return 0;
}