#include using namespace std; #define all(vec) vec.begin(),vec.end() typedef long long int ll; typedef pair P; const ll MOD=1000000007; const ll INF=1000000010; const ll LINF=4000000000000000010LL; const int MAX=310; const double EPS=1e-9; int dx[4]={0,1,0,-1}; int dy[4]={1,0,-1,0}; ll ncr(ll n,ll r){ ll f=1; for(int i=1;i<=n;i++){ f*=i; } ll ff=1; for(int i=1;i<=r;i++){ ff*=i; } ll fff=1; for(int i=1;i<=n-r;i++){ fff*=i; } return f/(ff*fff); } int main(){ ll n;cin>>n; ll t=1; int a=0,b=0; for(int i=0;i<=30;i++){ bool f=false; for(int j=2;j<=30-i;j++){ if(t*ncr(j,2)==n){ f=true; a=i;b=j; break; } } t*=2; if(f)break; } cout<