Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java 11, JAVA 8, Python, ZIG

We define the parity of an integer nn as the sum of the bits in binary representation computed modulo two. For example, the number 21 = 10101_221 = 10101_2 has three 11s in its binary representation so it has parity 3(\mod 2)3(\mod 2), or 11.

In this problem, you have to calculate the parity of an integer 1\leq I \leq 21474836471\leq I \leq 2147483647.

Input

Each line of the input has an integer II and the end of the input is indicated by a line where I=0I=0 that should not be processed.

Output

For each integer II in the input you should print a line The parity of B is P(mod 2)., where BB is the binary representation of II.

Sample Input

1
2
10
21
0

Sample Output

The parity of 1 is 1 (mod 2).
The parity of 10 is 1 (mod 2).
The parity of 1010 is 2 (mod 2).
The parity of 10101 is 3 (mod 2).

Comments

There are no comments at the moment.