#include <iostream>
#include <bitset>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int a,sum,b;
bool c;
while(true)
{
cin>>a;
if(a==0)
break;
bitset<32> ans(a);
sum=0;
c=false;
cout<<"The parity of ";
for(b=31;b>=0;b--)
{
if(!c && ans[b]==1)
c=true;
if(c)
cout<<ans[b];
sum+=ans[b];
}
cout<<" is "<<sum<<" (mod 2).\n";
}
return 0;
}