#include <iostream>
using namespace std;
int main() {
int a,b;
cin>>a>>b;
cout<<((a+b)*a+a)*a;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgYSxiOwoJY2luPj5hPj5iOwoJCgljb3V0PDwoKGErYikqYSthKSphOwoJCglyZXR1cm4gMDsKfQ==