#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif #define int long long #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define all(c) begin(c),end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9) + 7; template bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } using ld = long double; const double eps = 1e-8; ld bisection_method(ld x0, ld x1, std::function f) { ld y0 = f(x0), y1 = f(x1), m; int s0 = std::abs(y0) < eps ? 0 : y0 < 0 ? -1 : 1; int s1 = std::abs(y1) < eps ? 0 : y1 < 0 ? -1 : 1; assert(s0 * s1 <= 0); if (y0 > y1) std::swap(x0, x1); for (int i = 0; i < 200; i++) { m = (x0 + x1) / 2; if (f(m) > 0) x1 = m; else x0 = m; } return m; } std::vector quadratic_equation(ld a, ld b, ld c) { ld d = b * b - 4 * a * c; if (std::abs(a) < eps) return std::abs(b) > eps ? std::vector{-c / b} : std::vector{}; if (d < -eps) return{}; if (d < eps) return{ -b / (2 * a), -b / (2 * a) }; int sign = (b >= 0) ? 1 : -1; ld x0 = (-b - sign * sqrt(std::abs(d))) / (2 * a), x1 = c / (a * x0); if (x0 > x1) std::swap(x0, x1); return{ x0, x1 }; } std::vector cubic_equation(ld a, ld b, ld c, ld d) { if (std::abs(a) < eps) return quadratic_equation(b, c, d); if (a < 0) a = -a, b = -b, c = -c, d = -d; static const ld INF = 1e9; ld x0 = bisection_method(-INF, INF, [&](ld x) { return a * x * x * x + b * x * x + c * x + d; }); ld aa = 1, bb = b / a + x0, cc = c / a + bb * x0; auto res = quadratic_equation(aa, bb, cc); res.push_back(x0); std::sort(res.begin(), res.end()); return res; } signed main() { cin.tie(0); ios::sync_with_stdio(false); int a, b, c; cin >> a >> b >> c; auto w = cubic_equation(1, a, b, c); sort(all(w)); vector v; rep(i, -1, 2) { rep(j, 0, 3) { int x = w[j] + i; if (x*x*x + a*x*x + b*x + c == 0) v.push_back(x); } } sort(all(v)); v.erase(unique(v.begin(), v.end()), v.end()); cout << v[0]; rep(i, 1, v.size()) { cout << " " << v[i]; } cout << endl; return 0; }