#include using namespace std; int n; vector v; int main() { cin >> n; for (int i = 0; i < 30; ++i) if (n >> i & 1) v.push_back(i); if (v.size() < 2) cout << "-1 -1 -1" << endl; else { int res = 0; for (auto p : v) res |= 1 << p; cout << res; for (int i = 0; i < 2; ++i) { int now = res; for (int j = 0; j < v.size(); ++j) if (j % 2 == i) now ^= 1 << v[j]; cout << " " << now; } cout << endl; } return 0; }