#include<bits/stdc++.h>
using namespace std;
long long a,b,ans;
int main(){
cin>>a>>b;
long long k=b/__gcd(a,b);
cout<<k<<'\n';
for(int i=a;i<=b;i+=a){
long long aa=i,bb=k/(i/a)*a;
if(__gcd(aa,bb)==a&&aa/__gcd(aa,bb)*(bb/__gcd(aa,bb))*__gcd(aa,bb)==b){
cout<<aa<<' '<<bb<<'\n';
ans++;
}
}
cout<<ans;
return 0;
}
//O(b-a)
个人认为是没问题的,求hack或调或解释