#include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) using ll = long long; using P = pair; int main() { int N, A = -1, B = -1, C = -1; cin >> N; rep(i,N) rep(j,N) rep(k,N) { { { if(i|j == N && j|k == N && k|i == N && i ^ j ^ k == 0) { A = i; B = j; C = k; } } } } cout << A << B << C << endl; return 0; }