#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll mod = 1e9 + 7;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int a,b;
    cin >> a >> b;
    int ans;
    for(int i=b; i>=1; --i){
        int low = (a+i-1)/i;
        int high = b/i;
        if (high - low + 1 >= 2){
            ans = i;
            break;
        }
    }
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<int, int>;
using PL = pair<lint, lint>;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
constexpr int MOD = 1000000007;
constexpr lint B1 = 1532834020;
constexpr lint M1 = 2147482409;
constexpr lint B2 = 1388622299;
constexpr lint M2 = 2147478017;
constexpr int INF = 2147483647;
void yes(bool expr) {cout << (expr ? "Yes" : "No") << "\n";}
template<class T>void chmax(T &a, const T &b) { if (a<b) a=b; }
template<class T>void chmin(T &a, const T &b) { if (b<a) a=b; }
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  lint N, K;
  cin >> N >> K;
  K --;
  vector<lint> sum2(2*N-1);
  REP(i, 2*N-1) sum2[i] = min((lint)i, 2*N-2-i) + 1;
  vector<lint> sum3(3*N-2);
  sum3[0] = 1;
  FOR(i, 1, 2*N-1) sum3[i] = sum3[i-1] + sum2[i];
  FOR(i, 2*N-1, 3*N-2) sum3[i] = sum3[i-1];
  IFOR(i, N, 3*N-2) sum3[i] -= sum3[i-N];
  lint cnt = 0;
  REP(i, 3*N-2) {
    if(cnt+sum3[i] > K) {
      IFOR(j, max(i-N+1, 0LL), min((lint)i+1, 2*N-1)) {
        if(cnt + sum2[j] > K) {
          //cout << i << " " << j << " " << cnt << endl;
          cout << (lint)i-j+1 << " " << K-cnt+1+max(j-N+1, 0LL) << " " << (lint)j-(K-cnt)+1-max(j-N+1, 0LL) << endl;
          return 0;
        }
        cnt += sum2[j];
      }
      //cout << N << " " << N << " " << N << endl;
      return 0;
    }
    cnt += sum3[i];
  }
}