#include <stdio.h>
int main() {
long long int n,m[100],k,j;
while(scanf("%lld",&n)!=EOF){
for(int i=0;i<100;i++)m[i]=0;
if(n==0)break;
k=0;j=0;
while(n!=0){
m[k]=(n%2);
k++;
n/=2;
}
for(int i=0;i<100;i++)j+=m[i];
printf("The parity of ");
for(long long int i=k-1;i>=0;i--)printf("%lld",m[i]);
printf(" is %lld (mod 2).\n",j);
}
return 0;
}