#include<fstream>
#include<vector>
using namespace std;
const int NMAX = 256;
ifstream fin("lacate.in");
ofstream fout("lacate.out");
vector<int> matrix[NMAX + 1];
int main() {
int n;
fin >> n;
int cnt = 1;
int L = 0;
for (int i = 1; i <= n - 1; i++) {
for (int j = i + 1; j <= n; j++) {
matrix[i].push_back(cnt);
matrix[j].push_back(cnt);
cnt++;
L = max({L, matrix[i][matrix[i].size() - 1], matrix[j][matrix[j].size() - 1]});
}
}
fout << L <<' '<< matrix[1].size() << '\n';
for (int i = 1; i <= n; i++) {
for (auto j : matrix[i])
fout << j << ' ';
fout << '\n';
}
return 0;
}