#include <stdio.h>
int f;
long long n, k;
long long l, m, r;
long long x, y, z;
long long r1(long long a) {
	long long b = a * (a + 1) * (a + 2) / 6;
	if (a > n) {
		b -= (a - n) * (a - n + 1) * (a - n + 2) / 2;
	}
	return b;
}
long long r2(long long a) {
	long long b;
	if (x <= n) {
		b = x * (x + 1) / 2;
		b -= (x - a) * (x - a + 1) / 2;
		return b;
	}
	else {
		if (x - n < a) {
			b = n * (n + 1) / 2;
			b -= (n - a) * (n - a + 1) / 2;
			b += (x - n) * (a - (x - n) - 1);
		}
		else {
			b = (a + 2 * n - x - 1) * (a + 2 * n - x) / 2;
			b -= (2 * n - x - 1) * (2 * n - x) / 2;
		}
	}
	return b;
}
int main() {
	scanf("%lld%lld", &n, &k);
	if (2 * k == n * n * n + 1) {
		printf("%lld %lld %lld\n", (n + 1) / 2, (n + 1) / 2, (n + 1) / 2);
		return 0;
	}
	if (2 * k > n * n * n + 1) {
		k = n * n * n + 1 - k;
		f = 1;
	}
	r = n + (n - 1) / 2;
	while (r - l - 1) {
		m = (l + r) / 2;
		if (r1(m) < k)l = m;
		else r = m;
	}
	x = r;
	if (r > n)r = n;
	l = 0;
	k -= r1(x - 1);
	while (r - l - 1) {
		m = (l + r) / 2;
		if (r2(m) < k)l = m;
		else r = m;
	}
	y = r;
	z = k - r2(l);
	if (n < x && y <= x - n) {
		z += x - n - y + 1;
	}
	if (f)printf("%lld %lld %lld\n", n + 1 - y, n + 1 - z, n + 1 - (x - y - z + 2));
	else printf("%lld %lld %lld\n", y, z, x - y - z + 2);
}
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll seq[4000005];
int main(){
	ll n,k;
	cin>>n>>k;
	for(int i=n;i<=n*2-1;i++)seq[i]=i+1-n;
	for(int i=n*2;i<=n*3-2;i++)seq[i]=n*3-1-i;
	ll cnt=0,sum=0,S=3;
	int l=3*n-2,r=4*n-3;
	for(int I=1;I<=3*n-2;I++){
		cnt-=seq[r+1];
		cnt+=seq[l];
		if(sum+cnt>=k)break;
		else sum+=cnt;
		l--;
		r--;
		S++;
	}
	int p;
	for(p=1;p<=r-l+1;p++){
		if(sum+seq[p+l-1]>=k)break;
		else sum+=seq[p+l-1];
	}
	for(int i=1;i<=n;i++){
		if(p+i>=S-n && p+i<S)sum++;
		if(sum==k){
			cout<<p<<' '<<i<<' '<<S-p-i<<endl;
			break;
		}
	}
	return 0;
}