#include using namespace std; #define ll long long #define forin(in ,n) for(ll i=0; i>in[i] #define forout(out) for(ll i=0; i<(ll)out.size(); i++) cout<= n; --i) #define P pair #define all(v) v.begin(), v.end() #define fi first #define se second #define vvvll vector>> #define vvll vector> #define vll vector #define pqll priority_queue #define pqllg priority_queue, greater> constexpr ll INF = (1ll << 60); //constexpr ll mod = 1000000007; constexpr ll mod = 998244353; constexpr double pi = 3.14159265358979323846; template inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } template void pt(T val) { cout << val << "\n"; } template void pt_vll(vector &v) { ll vs = v.size(); rep(i, vs) { cout << v[i]; if (i == vs - 1) cout << "\n"; else cout << " "; } } ll mypow(ll a, ll n) { ll ret = 1; if(n==0) return 1; if(a==0) return 0; rep(i, n) { if (ret > (ll)(1e18 + 10) / a) return -1; ret *= a; } return ret; } long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } long long modinv(long long a, long long m) { long long b = m, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u; } ll digsum(ll n) { ll res = 0; while(n > 0) { res += n%10; n /= 10; } return res; } int main() { ll n,m,x,y,k,cnt,ans=-INF; cin>>n; rep(i,30){ if(n&(1<