#include<iostream>
#include<cstdio>

using namespace std;

int lj,p,j,d,t,c,pe;
int main(){
 cin>>lj>>p;
 cin>>j>>d>>t>>c>>pe;
 cout<<j-lj*p<<" "<<d-lj*p<<" "<<t-lj*p<<" "<<c-lj*p<<" "<<pe-lj*p<<endl;  
 //system("pause");   
 return 0;   
}
