#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n; cin >> n;
    vector<long long> d_s, d_l;
    long long i = 1;
    while(i*i < n)
    {
        if (n % i == 0)
        {
            d_s.push_back(i);
            d_l.push_back(n / i);
        }
        i++;
    }
    if (i * i == n) d_s.push_back(i);

    reverse(d_l.begin(), d_l.end());
    for (auto d: d_s) cout << d << endl;
    for (auto d: d_l) cout << d << endl;
    return 0;
}

// author: xay5421
// created: Sat Dec 26 19:58:52 2020
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
using namespace std;
int n;
int main(){
	scanf("%d",&n);
	rep(i,1,n){
		printf("%d %d\n",(i*2-1)%n+1,i*2%n+1);
	}
	return 0;
}