#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'void solve()
{int l,r; cin>>l>>r;vector<pair<int,int>>p;while(l<r){int pre=l,res=0;for(int i=0;i<=60;i++){if(l+(1LL<<i)>r) break;res=i;if(l>>i&1) break;}l+=1LL<<res;/*1后不加LL在i>31时会溢出!!!!!*/p.push_back({pre,l});}cout<<p.size()<<endl;for(auto [i,j]:p)cout<<i<<' '<<j<<endl;
}signed main()
{int t=1;// cin>>t; while(t--){solve();}
}
1LL<<i,记得加LL避免溢出!!!
25/2/23