#include <bits/stdc++.h>
#define ll long long
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define opps cout<<-1<<endl;
const ll con = 1e9;
using namespace std;
string binary(ll x) {
    ll temp = x;
    string s="";
    while (temp) {
        (temp % 2 == 0) ? s += '0' : s += '1';
        temp /= 2;
    }
    reverse(s.begin(), s.end());
    return s;
}
void solve(ll n) {
    int ones = 0 ;
    string x = binary(n);
    for (int i = 0 ; i < x.size() ; i++)
        x[i] == '1' ? ones++ : 0;
    cout<<"The parity of "<<x<<" is "<<ones<<" (mod 2)."<<endl;
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll n ;
    while (cin >> n && n != 0) {
        solve( n);
    }
}