#include <bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define rep(i,n) repi(i,0,n)
#define repi(i,a,n) for(ll i=a;i<(ll)n;++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define Show(val) cout<<(val)<<" "
#define Showln(val) cout<<(val)<<endl

using namespace std;
using ll = long long;
using P = pair<ll, ll>;
// using P = pair<int, int>;
void YN(bool a) { cout << (a ? "Yes" : "No"); }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

// BIT
// Binary Indexed Tree
// https://scrapbox.io/pocala-kyopro/%E8%BB%A2%E5%80%92%E6%95%B0
// 1-index
struct BIT {
private:
  vector<int> bit;
  int N;

public:
  BIT(int size) {
    N = size;
    bit.resize(N + 1);
  }

  // 一点更新
  void add(int a, int w) {
    for (int x = a; x <= N; x += x & -x) bit[x] += w;
  }

  // 1~Nまでの和を求める。
  int sum(int a) {
    int ret = 0;
    for (int x = a; x > 0; x -= x & -x) ret += bit[x];
    return ret;
  }
};

void solve()
{
  ll n;
  cin >> n;
  rep(i, n)
  {
    cout << i * 2 % n + 1 << " " << (i * 2 + 1) % n + 1 << endl;
  }
}

int main()
{
  fastio;
  solve();

  return 0;
}
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <ctype.h>
#include <math.h>
#include <stack>
#include <string>
#include <string.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const long double PI = acos(-1.0);
const ll mod = 1e9 + 7;
const ll INF = 1e9;
ll gcd(ll a, ll b) {if(a%b==0)return a;else return gcd(b,a%b);}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main() {
  ll n;
  cin >> n;
  
  ll a = 1;
  for(ll i = 1; i < 100; i++) {
    a *= 3;
    if(a > 1e18) break;
    ll b = 1;
    for(ll j = 1; j < 100; j++) {
      if(b*5 > 1e18) break;
      b *= 5;
      if(b > n-a || b > 1e18) break;
      if(b == n-a) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
    if(a*3 > 1e18) break;
  }
  cout << -1 << endl;
}
