#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) << ' ';
}