#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int a, b;
    cin >> a >> b;
    vector<ll> ans1, ans2;
    ll q = 0;
    for (int i = 1; i <= a; ++i) {
        ans1.emplace_back(i);
        q += i;
    }
    for (int i = 1; i <= b; ++i) {
        ans2.emplace_back(-i);
        q -= i;
    }
    if(q < 0){
        ans1.back() -= q;
    }else {
        ans2.back() -= q;
    }
    for (auto &&i : ans2) {
        ans1.emplace_back(i);
    }
    for (int i = 0; i < ans1.size(); ++i) {
        if(i) printf(" ");
        printf("%lld", ans1[i]);
    }
    puts("");
    return 0;
}
#line 2 "/home/defineprogram/Desktop/Library/template/template.cpp"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i < n; i++)
#define rev(i, n) for (int i = n - 1; i >= 0; i--)
#define REV(i, n) for (int i = n - 1; i > 0; i--)
#define all(v) v.begin(), v.end()
#define PL pair<ll, ll>
#define PI pair<int,int>
#define len(s) (int)s.size()

template <class T, class U>
inline bool chmin(T &a, U b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T, class U>
inline bool chmax(T &a, U b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
constexpr ll inf = 3e18;
#line 2 "main.cpp"

ll N, K;
ll dp[5][1 << 22];
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    dp[0][0] = 1;
    dp[0][1] = -1;
    rep(i, 4) {
        rep(j, 3000000) {
            dp[i][j + 1] += dp[i][j];
            if (!dp[i][j]) continue;
            dp[i + 1][j + 1] += dp[i][j];
            if (j + N + 1 <= 3000000) dp[i + 1][j + N + 1] -= dp[i][j];
        }
    }
    ll sum = 0;
    rep(i, 1 << 22) {
        if (sum + dp[3][i] >= K) {
            for (ll j = 1; j <= i - 2; j++) {
                ll l = max(i - (j + N), 1ll), r = min(i - (j + 1), N);
                int cnt = max(r - l + 1, 0ll);
                if (sum + cnt >= K) {
                    cout << j << " " << l + (K - sum - 1) << " "
                         << i - j - (l + (K - sum - 1)) << "\n";
                    return 0;
                }
                sum += cnt;
            }
        }
        sum += dp[3][i];
    }
}
