#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define all(v) v.begin(),v.end()
using i64=int64_t;

int main() {
    int n;
    cin>>n;
    vector<int> x(n),y(n),r(n);
    rep(i,n) {
        cin>>x[i]>>y[i]>>r[i];
    }
    vector<int> a(n),b(n),c(n),d(n);
    rep(i,n-5) {
        a[i]=i;
        b[i]=i;
        c[i]=i+1;
        d[i]=i+1;
        cout << a[i] << " " << b[i] << " " <<  c[i] << " " << d[i] << endl;
    }
    cout << n-5 << " " << n-5 << " " <<  "1000" << " " << "1000" << endl;
    cout << "1000" << " " << "1000" << " " <<  "2000" << " " << "2000" << endl;
    cout << "2000" << " " << "2000" << " " <<  "3000" << " " << "3000" << endl;
    cout << "3000" << " " << "3000" << " " <<  "4000" << " " << "4000" << endl;
    cout << "4000" << " " << "4000" << " " <<  "10000" << " " << "10000" << endl;
}
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 50;
const int inf = 1e9;
inline int lowbit(const int & x) { return x & (-x);}
int n, rt;
int ls[maxn], rs[maxn];
int a[maxn][maxn];
void check()
{
	for(int i = 1; i <= n; ++i) for(int j = 1; j <= n; ++j) a[i][j] = (i == j) ? 0 : inf;
	for(int i = 1; i <= n; ++i) a[i][ls[i]] = a[i][rs[i]] = 1;
	for(int k = 1; k <= n; ++k)
		for(int i = 1; i <= n; ++i)
			for(int j = 1; j <= n; ++j)
				a[i][j] = min(a[i][k] + a[k][j], a[i][j]);
	for(int i = 1; i <= n; ++i)
	{
		for(int j = 1; j <= n; ++j)
			printf("%d ", a[i][j]);
		puts("");
	}
}
int main()
{
	scanf("%d", &n);
	for(int i = 0; i < n; ++i)
	{
		ls[i] = (i << 1) % n + 1;
		rs[i] = (i << 1 | 1) % n + 1;
		printf("%d %d\n", ls[i], rs[i]);
	}
	//check();
	return 0;
} 
		