#include<bits/stdc++.h>
using namespace std;
int m,n,a,b;
bool flag = true;
int main()
{
cin>>m>>n;
for(a=m;a<=n;a++)
{
int c = pow(a,3)-pow((a-1),3);
for(b = 1;b*b < n;b++){
int temp = pow(b,2)+pow((b-1),2);
if((c==temp*temp)&&(a!=b)){
flag = false;
cout<<a<<" "<<b<<endl;
}
}
}
if(flag)
cout<<"No Solution"<<endl;
return 0;
}