#include <bits/stdc++.h>
//#include <atcoder/all>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
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;
}

const long long INF = 1e18;
//const ll mod = 1000000007;
ll N, K;
ll h(ll j) {
    ll ret = 0;
        if(j <= 0) return 0;
        if(j > 2 * N) {
            return 0;
        }
        if(j <= N + 1) {
            return j - 1;
        } else {
            ll k = N - (j - N) + 1;
            return k;
        }
        return ret;
}

ll g(ll j) {
    ll ret = 0;
        if(j <= 0) return 0;
        if(j > 2 * N) {
            ret += N * N;
            return ret;
        }
        if(j <= N + 1) {
            ret += (j - 1) * j / 2;
        } else {
            ret += N * N;
            ll k = N - (j - N) + 1;
            ret -= (k - 1) * (k) / 2;
        }
        return ret;
}

ll f(ll x) {
    ll ret = 0;
    for(ll i = 1; i <= N; i++) {
        ll j = x - i;
        ret += g(j);
    }
    return ret;
}

ll f2(ll x) {
    if(1 <= x and x <= N) return 1;
    return 0;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    ll ok = 0;
    ll ng = 3 * N + 1;
    while(abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;
        if(f(mid) < K) ok = mid;
        else ng = mid;
    }
    ll sum = ok + 1;
    K -= f(ok);
    //cout << ok << " " << K << endl;
    for(ll a = 1; a <= N; a++) {
        if(K > h(sum - a)) {
            K -= h(sum - a);
            continue;
        }
        for(ll b = 1; b <= N; b++) {
            if(K > f2(sum - a - b)) {
                K -= f2(sum - a - b);
                continue;
            }
            ll c = sum - a - b;
            cout << a << " " << b << " " << c << endl;
            return 0;
        }
    }
    return 0;
}
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <math.h>
#include <random>
#include <chrono>
#include <assert.h>
using namespace std ;
using ll = long long ;
using ld = long double ;
template<class T> using V = vector<T> ;
template<class T> using VV = V<V<T>> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
ll mod = 1000000007 ;
long double pie = acos(-1) ;
ll INF = 1e18 ;

void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
ll extGCD(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x = 1 ;
        y = 0 ;
        return a ;
    }
    ll d = extGCD(b,a%b,y,x) ;
    y -= a/b*x ;
    return d ;
}
void fix_cout(){cout << fixed << setprecision(20) ;}
template<class T> void chmax(T &a,T b){if(a<b) a = b ;}
template<class T> void chmin(T &a,T b){if(a>b) a = b ;}

int main(){
    ll n,k ;
    cin >> n >> k ;
    auto f = [&](ll a){
        ll res = 0 ;
        if(a-3<0) return res ;
        res += (a-1)*(a-2)/2 ;
        if(a-3-n<0) return res ;
        res -= (a-1-n)*(a-2-n)/2*3 ;
        if(a-3-2*n<0) return res ;
        res += (a-1-2*n)*(a-2-2*n)/2*3 ;
        if(a-3-3*n<0) return res ;
        res -= (a-1-3*n)*(a-2-3*n)/2 ;
        return res ;
    } ;
    V<ll> three(3*n+1,0) ;
    for(int i=0;i<=3*n;i++) three[i] = f(i) ;
    for(int i=1;i<=3*n;i++) three[i] += three[i-1] ;
    auto g = [&](ll a){
        ll res = 0 ;
        if(a-2<0) return res ;
        res += (a-1) ;
        if(a-2-n<0) return res ;
        res -= (a-1-n)*2 ;
        if(a-2-2*n<0) return res ;
        res += (a-1-2*n) ;
        return res ;
    } ;
    ll l=0,r=3*n,mid ;
    while(l+1<r){
        mid = (l+r)/2 ;
        if(three[mid]>=k) r = mid ;
        else l = mid ;
    }
    ll sum = r ;
    k -= three[l] ;
    V<ll> two(2*n+2,0) ;
    for(int i=1;i<=n;i++) if(2<=sum-i&&sum-i<=2*n) two[sum-i] = g(sum-i) ;
    for(int i=2*n-1;i>=0;i--) two[i] += two[i+1] ;
    // for(auto i:two) cout << i << " " ; cout << endl ;
    // cout << "???" << endl ;
    l = max(1ll,sum-2*n)-1 ;
    r = min(n,sum-2) ;
    while(l+1<r){
        mid = (l+r)/2 ;
        // cout << l << " " << mid << " " << r  << " " << k << endl ;
        if(sum-mid<=2*n&&(sum-mid<2||two[sum-mid]>=k)) r = mid ;
        else l = mid ;
    }
    // cout << sum << " " << r << endl ;
    k -= two[sum-r+1] ;
    mid = max(1ll,sum-r-n)+k-1 ;
    cout << r << " " << mid << " " << sum-r-mid << endl ;
}
