
/*

 ALLAH IS ALMIGHTY              ******BISMILLAHIR RAHMANIR RAHIM.******              ALLAH IS ALMIGHTY
                                    ```````````````````````````````
                                        AUTHOR: ANISUR RAHAMAN
                                            BSMRSTU(SHIICT)
                                                ID:017


                            ............LET's START OUR JOURNEY.............

*/
#include <bits/stdc++.h>

#define I_O ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

//~~~~~~~~~~~~ Sort Form Of Long~~~~~~~~~~~//
#define ll long long int
#define lls int64_t
#define ld long double
#define db double
#define ull unsigned long long int

//~~~~~~~~~~~~~~Pair~~~~~~~~~~~~~~~~~~//
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<db,db>
#define psi pair<string,int>
#define vi vector<int>
#define vl vector<ll>
#define vd vector<db>
#define vs vector<string>
#define vb vector<bool>
#define vpi vector<pii>
#define vpl vector<pll>
#define vpd vector<pdd>
#define vpsi vector<psi>

//~~~~~~~~~~~~~~Vector~~~~~~~~~~~~~~~~~//
#define pb push_back
#define pf push_front
#define MP make_pair
#define in insert
#define ff first
#define ss second
#define al(v) v.begin(),v.end()
#define alr(v) v.rbegin(), v.rend()
#define srt(v) sort(al(v))
#define srtr(v) sort(al(v), greater<int>());
#define len(x) ((ll)(x).length())
#define sz(x) ((ll)(x).size())
#define rev(v) reverse(al(v))
#define btcnt(n) __builtin_popcount(n)
#define acl(v, n) accumulate(al(v), n)
#define eb emplace_back
#define lb(v, kk) lower_bound(al(v), kk)
#define ub(v, kk) upper_bound(al(v), kk)
#define tpu(str) transform(al(str), str.begin(), ::toupper)
#define tpl(str) transform(al(str), str.begin(), ::tolower)
#define cignr cin.ignore(numeric_limits<streamsize>::max(), '\n');
#define mxv(v) *max_element(al(v))
#define mnv(v) *min_element(al(v))

const int MOD = 1e9 + 7;
const ll INF = 2e18;
const int mxn = 2e9 + 9;
const int mxd = 2e5 + 5;
const int mxa = 1e5 + 5;

//~~~~~~~~~~~~~~~~~~Function~~~~~~~~~~~~~~~~~~~~//
lls gcd(lls a, lls b){
    if(b == 0LL) return a;
    return gcd(b, a % b);
}

lls lcm(lls a, lls b){
    return (a / gcd(a, b) * b);
}

//~~~~~~~~~~~~~~~Loops and Short~~~~~~~~~~~~~~~~//

#define PI acos(-1)
#define Cn continue
#define Br break
#define off return 0
#define N '\n'
#define WT(something) auto az = something; cout << az << N;
#define WTS(something) cout << something << N;
#define rep(i, n) for(lls i = 0; (lls)i < n; i++)
#define repn(i, a, b) for(lls i = (lls)(a); i < (lls)(b); i++)
#define repr(i, a, b) for(lls i = (lls)(a) - 1; i >= (lls)(b); i--)
#define test_case() int T; T = 1; while(T--)

using namespace std;

lls maxll(lls x, lls y){ return x > y ? x : y; }
lls minll(lls x, lls y){ return x < y ? x : y; }
// ===================================~~~~~~ SOLUTION STARTS HERE ~~~~~~=================================== //

//int a, b, c, d, e, res = 0, ans = 0, prod = 1, n, m, cnt = 0, k, l, r, s, t, x, y, f, i, j, p;

void Run_Case()
{ 
    lls n, k;
    cin >> n >> k;
    for (int i = 0; i < k; i++) {
        if (n % 200 == 0) n /= 200;
        else {
            string str = to_string(n);
            str += "200";
            n = stoll(str);
        }
    }

    cout << n << N;
}

int main()
{
    I_O
    test_case()
    {
        Run_Case();
    }

    off;
}

#include<bits/stdc++.h>
#define inf 1e18
#define ll long long
#define endl "\n"
#define pb(a)  push_back(a)
#define mp(x,y) make_pair(x,y)
#define instr(str) string str; cin>>str;
#define loop(i,x,y) for(int i = x; i < y ; i++ )
#define rev(i,x,y) for(int i = x; i >= y ; i--)
#define in(n)       int n; cin>>n;
#define tc int t;cin>>t;while(t--)
#define inarr(arr,n) int arr[n]; for(int i = 0; i < n ; i++){cin>>arr[i];}
#define ff first
#define sec second
#define mem(a,c) mvemset(a,c,sizeof(a))
#define bitcount(x) __builtin_popcountll(x)
#define maploop(x) for(auto itr = x.begin(); itr != x.end();itr++)
int mod = 1000000007;
#define int long long
using namespace std;
bool isp(int x) {
	for (int i = 2; i * i <= x; ++i)
		if (x % i == 0) return false;
	return true;
}
void pog()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b)
{
	return (a.first > b.first);
}
// bool prime[1000000 + 1];
// void SieveOfEratosthenes()
// {
// 	memset(prime, true, sizeof(prime));

// 	prime[1] = false;

// 	for (int p = 2; p * p <= 10000000; p++) {

// 		// If prime[p] is not changed, then it is a prime
// 		if (prime[p] == true) {

// 			// Set all multiples of p to non-prime
// 			for (int i = p * 2; i <= 10000000; i += p)
// 				prime[i] = false;
// 		}
// 	}
// }
bool prime_check(int n)
{
	bool flag = 1;
	for (int i = 2; i <= sqrt(n); i++) {

		// If n is divisible by any number between
		// 2 and n/2, it is not prime
		if (n % i == 0) {
			flag = 0;
			break;
		}
	}
	return flag;
}
long long power( long long x,
                 int y, int p)
{
	long long res = 1; // Initialize result

	x = x % p; // Update x if it is more than or
	// equal to p

	while (y > 0) {
		// If y is odd, multiply x with result
		if (y & 1)
			res = (res * x) % p;

		// y must be even now
		y = y >> 1; // y = y/2
		x = (x * x) % p;
	}
	return res;
}
bool sortbysec(const pair<int, int> &a,
               const pair<int, int> &b)
{
	return (a.second < b.second);
}

/*************************************************************************/
void Main()
{
	in(n)
	inarr(arr, n)
	inarr(arr1, n)
	int res[n];
	res[0] = arr[0] * arr1[0];
	int maxi[n];
	maxi[0] = arr[0];
	loop(i, 1, n)
	{
		maxi[i] = max(maxi[i - 1], arr[i]);
	}
	loop(i, 1, n)
	{
		res[i] = max(res[i - 1], arr[i] * arr1[i]);
		res[i] = max(res[i], maxi[i - 1] * arr1[i]);
	}
	loop(i, 0, n)
	{
		cout << res[i] << endl;
	}
}

int32_t main()

{
	srand(time(0));
	pog();
	int t = 1 ;
	// int t;
	// cin >> t;
	while (t--)
	{
		Main();
	}

#ifndef ONLINE_JUDGE
	cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
#endif
}