#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, cnt;
vector < int > V[1 << 9];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
ifstream cin("lacate.in");
ofstream cout("lacate.out");
cin >> n;
cout << (n - 1) * n / 2 << " " << n - 1 << "\n";
for (int i = 1; i <= n; i++) {
for (int j = i + 1; j <= n; j++) {
V[i].push_back(++cnt);
V[j].push_back(cnt);
}
}
for (int i = 1; i <= n; i++, cout << "\n")
for (auto it : V[i])
cout << it << " ";
return 0;
}