#pragma region template // clang-format off #include #if (defined LOCAL_JUDGE) || (!__has_include ()) #define see(...) ((void) 0) #define here(...) ((void) 0) #define com(msg) ((void) 0) #define local(x) ((void) 0) #define alter(x,y) y #else #include #define see(...) debugger::print(#__VA_ARGS__, __VA_ARGS__) #define here(...) debugger::output << "[Debug] " << #__VA_ARGS__ << (strlen(#__VA_ARGS__) ? " | " : "") << "line " << __LINE__ << " (" << __func__ << ")\n" #define com(msg) debugger::output << "[Debug] " << msg << "\n" #define local(x) do{x} while(0) #define alter(x,y) x #endif #ifdef NDEBUG #define NOEXCEPT noexcept #define M_assert(expr) ((void) 0) #define O_assert(expr) ((void) 0) #elif defined ONLINE_JUDGE #define NOEXCEPT noexcept #define M_assert(expr) do{if(__builtin_expect(!(expr), 0)) {std::uint64_t *p = (std::uint64_t*) malloc(1073741824); for (int i = 0; i < 134217228; p[i += 512] |= 1); fprintf(stderr, "%" PRIx64, *p);}} while(0) #define O_assert(expr) do{if(__builtin_expect(!(expr), 0)) while(1) printf("Hello, world!\n");} while(0) #else #define NOEXCEPT #define M_assert(expr) assert(expr) #define O_assert(expr) assert(expr) #endif #define rep(i,n) for(int i = 0; i < (int)(n); i++) using std::string; using std::vector; [[maybe_unused]] constexpr int INF = 1000000005; [[maybe_unused]] constexpr long long LINF = 1000000000000000005LL; [[maybe_unused]] constexpr double EPS = 1e-9; [[maybe_unused]] constexpr int dy[8] = {1, 0, -1, 0, 1, 1, -1, -1}; [[maybe_unused]] constexpr int dx[8] = {0, 1, 0, -1, -1, 1, 1, -1}; template T Abs(T a) { return std::abs(a); } template > ReturnType Abs(S a, T b) { return std::abs((ReturnType) a - b); } template > ReturnType Min(S a, T b, Ts... c) { if constexpr (sizeof...(Ts) > 0) return std::min((ReturnType) a, (ReturnType) Min(b, c...)); else return std::min((ReturnType) a, (ReturnType) b); } template > ReturnType Max(S a, T b, Ts... c) { if constexpr (sizeof...(Ts) > 0) return std::max((ReturnType) a, (ReturnType) Max(b, c...)); else return std::max((ReturnType) a, (ReturnType) b); } // clang-format on #pragma endregion void solve() { int N; scanf("%d", &N); vector bits; for (int i = 0; i < 31; i++) { if ((N >> i) & 1) { bits.emplace_back(i); } } int A, B, C; if (bits.size() <= 1) { puts("-1 -1 -1"); return; } if (bits.size() == 2) { A = (1 << bits[0]); B = (1 << bits[0]) + (1 << bits[1]); C = (1 << bits[1]); } else { A = N ^ (1 << bits.back()); B = N ^ (1 << bits.front()); C = (1 << bits.back()) + (1 << bits.front()); } assert((A | B) == N && (B | C) == N && (C | A) == N); M_assert((A ^ B ^ C) == 0); printf("%d %d %d\n", A, B, C); } int main() { solve(); }