#include #include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io(){ std::cin.tie(nullptr); std::ios::sync_with_stdio(false); }; } fio; int cal(int D){ for(int i = D/2, j = 0; i <= D && j <= 10000000; i++, j++){ int sum = 0; int x = i; while(x){ sum += x; if(sum == D) return i; x /= 2; } } for(int i = D * 6 /10, j = 0; i <= D && j <= 10000000; i++, j++){ int sum = 0; int x = i; while(x){ sum += x; if(sum == D) return i; x /= 2; } } for(int i = D * 7 /10, j = 0; i <= D && j <= 10000000; i++, j++){ int sum = 0; int x = i; while(x){ sum += x; if(sum == D) return i; x /= 2; } } return D; } signed main(){ cout<>D; cout<