#include<bits/stdc++.h>
#define int long long
using namespace std;
int a[10010];
signed main(){
int n;
cin>>n;
int ans=1,now=n,k=1;
if(n==1){
cout<<1<<endl<<1;
return 0;
}
for(int i=1;i<=n;i++){
if(now/2==1){
a[k]=now;
ans*=now;
sort(a+1,a+k+1);
for(int j=1;j<=k;j++){
cout<<a[j]<<" ";
}
cout<<endl;
cout<<ans;
return 0;
}
if(now%2==0){
a[k]=now/2;
k++;
ans*=now/2;
}else{
a[k]=now/2+1;
k++;
ans*=(now/2+1);
}
now/=2;
}
return 0;
}