#include <bits/stdc++.h>
int main() {
int a,b,c,d; std::cin >> a >> b >> c >> d;
auto p = [&](int x) {
// calculate p(x) = a*x^3+b*x^2+c*x+d
// coefficients a,b,c,d is captured from local scope
return d + x * (c + x * (b + x * 1LL * a));
};
for (int x = -5; x <= 5; x++) std::cout << p(x) << ' ';
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CmludCBtYWluKCkgewogICAgaW50IGEsYixjLGQ7IHN0ZDo6Y2luID4+IGEgPj4gYiA+PiBjID4+IGQ7CiAgICBhdXRvIHAgPSBbJl0oaW50IHgpIHsKICAgICAgICAvLyBjYWxjdWxhdGUgcCh4KSA9IGEqeF4zK2IqeF4yK2MqeCtkCiAgICAgICAgLy8gY29lZmZpY2llbnRzIGEsYixjLGQgaXMgY2FwdHVyZWQgZnJvbSBsb2NhbCBzY29wZQogICAgICAgIHJldHVybiBkICsgeCAqIChjICsgeCAqIChiICsgeCAqIDFMTCAqIGEpKTsKICAgIH07CiAgICBmb3IgKGludCB4ID0gLTU7IHggPD0gNTsgeCsrKSBzdGQ6OmNvdXQgPDwgcCh4KSA8PCAnICc7Cn0=