#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define bit(n,k) ((n>>k)&1) //nのk　bit目
#define vec(T) vector<T>
#define vvec(T) vector<vector<T>>
using ll = long long;
using P = pair<int,int>;
using Pll = pair<ll,ll>;


template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll llINF = 1LL << 60;
const int iINF = 1e9;

//------------------------------------------------


struct Solver{

    void solve(){
        ll A,B;
        cin >> A>>B;

        ll ans=1;

        rep1(g,B) if( ceil(A/double(g)) < floor(B/double(g)) ) ans=g;
        
        cout  << ans << endl;
    }
};


int main(){
    int testcasenum=1;
    //cin >> testcasenum;
    rep1(ti,testcasenum){
        Solver solver;
        solver.solve();
    }
    return 0;
}

#include "bits/stdc++.h"
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define FI first
#define SE second
#define maxn 2000
#define mod 1000000007
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef double db;

int lg[maxn+5];
int a[maxn+5],b[maxn+5];
int n; 

int d[maxn+5][maxn+5];

void adj(int &x)
{
    if(x & (1<<lg[n-1])) x^=1<<lg[n-1];
    if(x>=n) x^=1<<(lg[n-1]-1);
}
int main()
{
    scanf("%d",&n);
    rep(i,1,n) lg[i]=lg[i>>1]+1;
    rep(i,0,n-1)
    {
        a[i]=i*2;
        b[i]=i*2+1;
        adj(a[i]);
        adj(b[i]);
    }
    /*
    rep(i,1,n) rep(j,1,n) d[i][j]=inf;
    rep(i,0,n-1) d[i+1][a[i]+1]=d[i+1][b[i]+1]=1;
    rep(i,1,n) d[i][i]=0;
    rep(k,1,n) rep(i,1,n) rep(j,1,n) d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
    rep(i,1,n) rep(j,1,n) assert(d[i][j]<=10);
    */

    rep(i,0,n-1) printf("%d %d\n",a[i]+1,b[i]+1);
    return 0;
}