#include<iostream>
using namespace std;
using ll = long long;

ll sum_comb(ll n) {
  if (n <= 2) return 0;
  return (n - 1) * (n - 2) / 2;
}

ll sum_comb2(ll n, ll N) {
  return (sum_comb(n) - sum_comb(n - 3 * N)) - 3 * (sum_comb(n - N) - sum_comb(n - 2 * N));
}

int main() {
  int N; ll K;
  cin >> N >> K;
  ll cnt = 0; int sum = 3;
  while (true) {
    cnt += sum_comb2(sum, N);
    if (cnt >= K) break;
    sum++;
  }
  cnt -= sum_comb2(sum, N);
  
  int i = 1;
  while (true) {
    cnt += max(0, min(sum - i - 1, 2 * N - sum + i + 1));
    if (cnt >= K) break;
    i++;
  }
  cnt -= min(sum - i - 1, 2 * N - sum + i + 1);
  
  int j = K - cnt + max(0, sum - i - N - 1);
  int k = sum - i - j;
  
  cout << i << " " << j << " " << k << endl;
}
#include<bits/stdc++.h>
#define int long long
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#define ri register signed
#define rd(x) x=read()
#define fi first
#define se second
#define mp make_pair
using namespace std;
const int N=3e6+5;
const int M=31;
const int mod=1e9+7;
inline int read(){int x=0,f=1;char ch=getchar();while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;}
inline int ksm(int x,int y=mod-2,int z=mod){int ret=1;while (y){if (y&1) ret=(ret*x)%z;x=(x*x)%z;y>>=1;}return ret;}
int inv[N],fac[N],ifc[N];
void Init(int n)
{
    inv[1]=1;for (ri i=2;i<=n;i++)inv[i]=inv[mod%i]*(mod-mod/i)%mod;
    fac[0]=1;for (ri i=1;i<=n;i++) fac[i]=fac[i-1]*i%mod;
    ifc[0]=1;for (ri i=1;i<=n;i++) ifc[i]=ifc[i-1]*inv[i]%mod;
}
int C(int n,int m){if (m>n || m<0) return 0;return fac[n]*ifc[m]%mod*ifc[n-m]%mod;}
int n,m,ans,tot,tmp,K,a,b,c;
int cnt1[N],cnt2[N],cnt3[N];
signed main()
{
    rd(n);rd(K);
    //a+b+c=i
    //a=j
    //b+c=i-j
    //2->1 1
    //1 1 1
    //1 1 2 1 2 1 1 2 2
    //
    for (int i=1;i<=n;i++) cnt1[i]=1;
    tot=0;
    for (int i=1;i<=2*n;i++) 
    {
        cnt2[i]+=tot;
        if (i<=n) tot+=cnt1[i];
        else tot+=cnt1[i],tot-=cnt1[i-n];
    }
    for (int i=1;i<=3*n;i++) 
    {
        cnt3[i]+=tot;
        if (i<=n) tot+=cnt2[i];
        else tot+=cnt2[i],tot-=cnt2[i-n];
    }
    //for (int i=1;i<=3*n;i++) printf("cnt[%lld]=%lld\n",i,cnt3[i]);
    for (int i=3;i<=3*n;i++)
    {
        tmp=cnt3[i];
        //n 以内选 3 个数之和为 x 的方案数
        //
        tot+=tmp;
        if (tot>=K)
        {
            tot-=tmp;
            for (int j=1;j<=i-2;j++)
            {
                tmp=cnt2[i-j];
                tot+=tmp;
                if (tot>=K)
                {
                    a=j;
                    tot-=tmp;
                    for (int k=1;k<=i-j;k++)
                    {
                        b=k;
                        c=i-a-b;
                        if (c<=n) tot++;
                        if (tot==K){ cout<<a<<" "<<b<<" "<<c<<endl;return 0;}
                    }
                    
                }
            }
        }
    }
}
