#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
vector<int> vect1,vect2;
int main(){
int a,b;
cin>>a>>b;
while(a!=1){
vect1.push_back(a);
a=a/2;
}
while(b!=1){
vect2.push_back(b);
b=b/2;
}
vect1.push_back(1);注意1
vect2.push_back(1);
sort(vect1.begin(),vect1.end());
sort(vect2.begin(),vect2.end());
int cnt=min(vect1.size(),vect2.size());
for(int i=0;i<cnt;i++){
if(i==cnt-1&&vect1[i]==vect2[i]){
cout<<vect1[i]<<endl;
return 0;
}
if(vect1[i]!=vect2[i]){
cout<<vect1[i-1]<<endl;
return 0;
}
}
}
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
vector<int> vect1,vect2;
int main(){
int a,b;
cin>>a>>b;
while(a!=1){
vect1.push_back(a);
a=a/2;
}
while(b!=1){
vect2.push_back(b);
b=b/2;
}
vect1.push_back(1);注意1
vect2.push_back(1);
sort(vect1.begin(),vect1.end());
sort(vect2.begin(),vect2.end());
int cnt=min(vect1.size(),vect2.size());
for(int i=0;i<cnt;i++){
if(i==cnt-1&&vect1[i]==vect2[i]){
cout<<vect1[i]<<endl;
return 0;
}
if(vect1[i]!=vect2[i]){
cout<<vect1[i-1]<<endl;
return 0;
}
}
}