#include #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; typedef long long ll; int main(){ ll n;cin>>n; ll a=n/2,b=n-n/2; if(__builtin_popcount(a)==1||__builtin_popcount(b)==1)puts("-1"); else cout<