#include<bits/stdc++.h>
using namespace std;

long long sum[5][3000005];

int main() {
    long long N,K;
    cin >> N >> K;
    for(int i = 1; i <= N; i++) {
        sum[0][i] = 1;
    }
    for(int i = 1; i <= 1000000; i++) {
        sum[1][i+1] += sum[0][i];
        sum[1][i+N+1] -= sum[0][i];
    }
    for(int i = 1; i <= 2000000; i++) {
        sum[1][i+1] += sum[1][i];
    }
    for(int i = 1; i <= 2000000; i++) {
        sum[2][i+1] += sum[1][i];
        sum[2][i+N+1] -= sum[1][i];
    }
    for(int i = 1; i <= 3000000; i++) {
        sum[2][i+1] += sum[2][i];
    }
    for(int i = 1; i <= 3000000; i++) {
        sum[2][i+1] += sum[2][i];
    }
    long long l = 0,r = N*3;
    while (l+1 < r) {
        long long mid = (l+r)/2;
        if(sum[2][mid] >= K) {
            r = mid;
        }
        else {
            l = mid;
        }
    }
    long long sum2 = 0;
    for(int i = 1; i <= N; i++) {
        int b = r-N-i;
        int c = N;
        if(b > N) {
            continue;
        }
        if(b <= 0) {
            c += b-1;
            b = 1;
        }
        if(c <= 0) {
            continue;
        }
        if(sum[2][r-1]+sum2+c-b+1 >= K) {
            int a = i;
            int d = b+K-sum[2][r-1]-sum2-1;
            cout << a << " " << d << " " << r-a-d << endl;
            return 0;
        }
        sum2 += c-b+1;
    }
}

#include <bits/stdc++.h>
using namespace std;
typedef long long lli;

lli pref[2000005];

int main() {
	lli n, k, m, sum, a, b, mini, maxi;
	scanf("%lld %lld", &n, &k);
	m = 2 * n;
	for (lli i = 2; i <= m; i++)
		pref[i] = pref[i - 1] + i - 1 - (2 * max(0LL, i - n - 1));
	sum = 2;
	m = 0;
	while (m < k) {
		k -= m;
		sum++;
		mini = max(1LL, sum - n - n);
		maxi = min(n, sum - 2);
		m = pref[sum - mini] - pref[sum - maxi - 1];
	}
	a = mini - 1;
	m = 0;
	while (m < k) {
		k -= m;
		a++;
		m = pref[sum - a] - pref[sum - a - 1];
	}
	b = k - 1 + max(1ll, sum - a - n);
	printf("%lld %lld %lld\n", a, b, sum - a - b);
	return 0;
}