#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,k;
	cin>>n>>k;
	while(k--)
	{
		if(n%200==0)
		{
			n/=200;
		}
		else
		{
			n=n*1000+200;
		}
	}
	cout<<n;
	return 0;
}
#pragma GCC optimization ("O3")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<pair<ll,ll>,null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update>
typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define ll long long
#define endl "\n"
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll M = 1e9 + 7;
const ll N = 3e6 + 5;

ll dp[3][N];
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast


    ll n, k;
    cin >> n >> k;
    memset(dp, 0, sizeof dp);
    for(ll i = 1; i <= 3 * n; i++)dp[0][i] = min(n, i);
    for(ll j = 1; j < 3; j++)
        for(ll i = 1; i <= 3 * n; i++)
            dp[j][i] = dp[j][i - 1] + dp[j - 1][i - 1] - dp[j - 1][max(0ll, i - n - 1)];

    ll sum = lower_bound(dp[2], dp[2] + 3 * n + 1, k) - dp[2];
    k -= dp[2][sum - 1];

    for(ll i = 1; i <= sum - 2; i++)
    {
        if(dp[1][sum - i] - dp[1][sum - i - 1] >= k)
        {
            cout << i << " ";
            sum -= i;
            break;
        }
        k -= dp[1][sum - i] - dp[1][sum - i - 1];
    }
    for(ll i = 1; i <= sum - 1; i++)
    {
        if(dp[0][sum - i] - dp[0][sum - i - 1] >= k)
        {
            cout << i << " ";
            sum -= i;
            break;
        }
        k -= dp[0][sum - i] - dp[0][sum - i - 1];
    }
    cout << sum << endl;

}

