#include<stdio.h>
#include<math.h>
int main()
{
 __int64 a[8]={2,3,5,7,13,17,19,31};  //    perfect=( 2^( n-1 )
)*(2^n-1)   //( 2^n – 1 ) is a prime number  ,

                                                                        
//      and n==a[ i ]澳门新葡萄京所有网站,—>prime number
 __int64 i,n,k,perfect[8];
 while(scanf(“%I64d”,&n)!=EOF)
  for(i=0;i<8;i++)
  {
   k=pow(2,a[i])-1;
   perfect[i]=(k+1)/2*k;
   if(perfect[i]<=n)
    printf(“%I64dn”,perfect[i]);
   else break;
  }
 return 0;
}