#include using namespace std; using lint = long long; template using V = vector; template using VV = V< V >; lint powll(lint a, int n) { assert(n >= 0); lint res = 1; for (; n > 0; a *= a, n >>= 1) if (n & 1) res *= a; return res; } // Ax=b(A_{ij}=a_{i+j})をO(n^2)で解くかもしれない(は?) template V levinson_durbin(const V& a, const V& b) { assert(a.size() == 2 * b.size() - 1); int n = b.size(); if (!a[n - 1]) return {}; V p(n), q(n), x(n); p.back() = q[0] = 1 / a[n - 1]; x.back() = b[0] / a[n - 1]; for (int k = 1; k < n; ++k) { T ep = inner_product(begin(a) + n, begin(a) + n + k, begin(p) + n - k, (T) 0); T eq = inner_product(begin(a) + n - 1 - k, begin(a) + n - 1, begin(q), (T) 0); T e = inner_product(begin(a) + n, begin(a) + n + k, begin(x) + n - k, (T) 0); if (!(1 - ep * eq)) { for (int i = 0; i < n; ++i) { if (inner_product(begin(a) + i, begin(a) + i + n, begin(x), (T) 0) != b[i]) { return {}; } } return x; } T c = 1 / (1 - ep * eq); for (int i = 0; i <= k; ++i) { T tp = i ? p[n - 1 - k + i] : 0, tq = i < k ? q[i] : 0; tie(p[n - 1 - k + i], q[i]) = make_pair(c * (tp - ep * tq), c * (tq - eq * tp)); x[n - 1 - k + i] += (b[k] - e) * q[i]; } } return x; } // aが線形漸化的のとき係数をO(n^2)で復元するかもしれない(は?) template V restore_coeff(const V& a) { int k = a.size() >> 1; while (k) { auto c = levinson_durbin(V(begin(a), begin(a) + 2 * k - 1), V(begin(a) + k, begin(a) + 2 * k)); auto chk = [&]() -> bool { for (int i = 0; i + k < (int) a.size(); ++i) { if (inner_product(begin(c), end(c), begin(a) + i, (T) 0) != a[i + k]) { return false; } } return true; }; if (!c.empty() and chk()) { int i = 0; while (i < k and !c[i] and inner_product(begin(c) + i + 1, end(c), begin(a), (T) 0) == a[k - 1 - i]) ++i; return V(begin(c) + i, end(c)); } --k; } return {}; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); // 1e6以下を愚直に列挙 V da; for (lint i = 1; i <= 1e6; ++i) { lint s = i * i + (i + 1) * (i + 1); lint sq = sqrt(s); if (sq * sq == s) da.push_back(i); } // どうせ線形漸化式に従うので復元 auto dcoeff = restore_coeff(da); assert(!dcoeff.empty()); int k = dcoeff.size(); V coeff(k), res(k); for (int i = 0; i < k; ++i) { coeff[i] = dcoeff[i]; res[i] = da[i]; } while (true) { lint nxt = inner_product(begin(coeff), end(coeff), end(res) - k, 0LL); if (nxt >= 1e18) break; res.push_back(nxt); } int x; cin >> x; lint a = *lower_bound(begin(res), end(res), powll(10, x - 1)); lint b = a + 1, c = sqrt(1.0L * a * a + 1.0L * b * b); cout << a << ' ' << b << ' ' << c << '\n'; }