#include <bits/stdc++.h> using namespace std; int main() { int a,b,c,d,e,f,g,h; cin>>a>>b>>c>>d>>e; f=a*c+b*(c*2*2); g=a*d+b*(d*3*2); h=a*e+b*(e*3*3); cout<<f<<" "<<g<<" "<<h; return 0; }