#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int I;
while(cin >> I){
int P = 0;
string binary;
if(I==0) break;
while(I){
if(I%2==1){
binary.push_back('1');
P++;
}
else{
binary.push_back('0');
}
I/=2;
}
reverse(binary.begin(),binary.end());
cout << "The parity of " << binary << " is "<< P << " (mod 2)." << "\n";
}
return 0;
}