#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;
typedef long long int lli;
typedef vector<int> vi;
typedef vector<long long int> vlli;
typedef pair<int,int> pii;
typedef pair<long long int,long long int> plli;
typedef vector< vi > vvi ;
typedef vector< vlli > vvlli  ;
#define fi(i,a,b) for(int i=a;i<=b;i++)
#define flli(i,a,b) for(long long int i=a;i<=b;i++)
#define bi(i,a,b) for(int i=a;i>=b;i--)
#define blli(i,a,b) for(long long int i=a;i>=b;i--)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define all(x) x.begin(),x.end()
#define sz(x) x.size()
#define pi 2*acos(0.0)
#define pb push_back
#define tr(v,it) for(decltype(v.begin()) it=v.begin();it!=v.end();it++)
#define present(v,num) (v.find(num)!=v.end())
#define cpresent(v,num) (find(v.begin(),v.end(),num)!=v.end())
#define pq priority_queue
#define mp make_pair
const int inf=INT_MAX;
const lli INF =LLONG_MAX;
const lli mod = 1e9+7;
int main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fast;
    lli n;cin>>n;
    vlli sum2(2*n+1,0);
    flli(i,1,n)
    {
    	sum2[i+1]++;
    	if(i+n+1<=2*n)
    		sum2[i+n+1]--;
    }
    flli(i,1,2*n)
    	sum2[i]=sum2[i-1]+sum2[i];
    vlli sum3;
    sum3.pb(0);
    sum3.pb(0);
    sum3.pb(0);
    flli(i,3,n+2)
    {
    	lli temp=((i-2)*(i-1))/2;
    	sum3.pb(temp);
    }
    for(lli i=n-2;i>0;i-=2)
    {
    	lli temp=sum3.back();
    	temp=temp+i;
    	sum3.pb(temp);
    }
    //now just copy everything 
    lli idx=sz(sum3)-1;
    if(n%2)idx--;
    while(idx>2)
    {
    	sum3.pb(sum3[idx]);
    	idx--;
    }
    lli szsum3=sz(sum3);
    flli(i,1,szsum3-1)sum3[i]+=sum3[i-1];
    lli k;cin>>k;
    auto findi=lower_bound(all(sum3),k);
    lli sumfind=findi-sum3.begin();
    //find first number
    k=k-sum3[sumfind-1];
    flli(beauty,1,n)
    {
    	if(beauty+2*n<sumfind)continue;
    	if(beauty+2>sumfind)continue;
    	if(sum2[sumfind-beauty]>=k)
    	{
    		//we found the beauty no
    		cout<<beauty<<" ";
    		//now we need to find taste and popularity 
    		lli remsum=sumfind-beauty;
    		flli(taste,1,n)
    		{
    			lli newremsum=remsum-taste;
    			if(newremsum>=1 && newremsum<=n && k==1)
    			{
    				cout<<taste<<" "<<newremsum;
    				return 0;
    			}
    			else if(newremsum>=1 && newremsum<=n)
    			{
    				k--;
    			}
    		}
    		assert(false);
    	}
    	else
    	{
    		k-=sum2[sumfind-beauty];
    	}
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
    return 0;
}
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<ll, ll>;
using tp = tuple<ll, ll, ll>;

template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;

#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
#define rep(i, m, n) for(ll i = (ll)(m); i < (ll)(n); ++i)
#define rep2(i, m, n) for(ll i = (ll)(n)-1; i >= (ll)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)

constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
//constexpr long long MOD = 998244353LL;
static const ld pi = 3.141592653589793L;

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

template <class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

//グラフ関連
struct Edge {
    int to, rev;
    ll cap;
    Edge(int _to, ll _cap, int _rev) : to(_to), cap(_cap), rev(_rev) {}
};

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph &G, int from, int to, ll cap, bool revFlag, ll revCap) {
    G[from].push_back(Edge(to, cap, (int)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (int)G[from].size() - 1));
}

void solve() {
    ll n, k;
    cin >> n >> k;

    ll num = 0;
    ll pre = 0;
    k--;
    rep(s, 3, n * 3 + 1) {
        //合計
        ll tmp = pre;
        if(s <= 2 * n + 1) {
            ll r = min(s - 1 - 1, n);
            ll l = max(1LL, s - 1 - n);
            tmp += r - l + 1;
        }
        if(s >= n + 2) {
            ll r = min(s - (n + 1) - 1, n);
            ll l = max(1LL, s - (n + 1) - n);
            tmp -= r - l + 1;
        }
        pre = tmp;

        //cout << s << " " << num << en;
        if(num + tmp <= k) {
            num += tmp;
            continue;
        }
        rep(i, 1, n + 1) {
            ll r = min(s - i - 1, n);
            ll l = max(1LL, s - i - n);
            ll nxt = max(0LL,r - l + 1);
            if(num + nxt <= k) {
                //cout<<num<<" "<<nxt<<" "<<k<<en;
                num += nxt;
                continue;
            }
            ll j = k - num + l;
            cout << i << " " << j << " " << s - i - j << en;
            return;
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    // ll t;
    // cin >> t;
    // REP(i, t - 1) {
    //     solve();
    // }

    solve();

    return 0;
}
