/*
TASK: mob
LANG C++
*/
#include<iostream>
#include<math.h>
#include<vector>
using namespace std;
int main()
{
 long a,b,i,j,r,ok=0,n,s;
 vector<long> x;
 cin>>a>>b;
 
 for(i=a;i<=b;i++)
 {
  n=i;
  if(n==1)
   cout<<"1"<<endl;

  for(j=2;j<=sqrt(n);j++)
   if(n%j==0)
   {
    n=n/j;
    x.push_back(j);
    j--;
   }
  s=x.size();
  if(s==0 && n!=1)
   cout<<"-1"<<endl;
  sort(x.begin(),x.end());   
  for(j=0;j<=s-2;j++)
   for(r=j+1;r<=s-1;r++)
    if(x[j]==x[r])
    {cout<<"0"<<endl;ok=1;break;}
  if(ok==0)
   if(s%2==0 && s>0)
    cout<<"1"<<endl;
   else
    if(s%2!=0 && s>0)
     cout<<"-1"<<endl;
 }
 
 
 //system("pause");
 return 0;
}
