Count set bits of X
while ( X != 0 ) : NEW_LINE INDENT X = ( X - 1 ) & X NEW_LINE count += 1 NEW_LINE DEDENT if ( count % 2 == 0 ) : NEW_LINE INDENT print ( even , odd ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( odd , even ) NEW_LINE DEDENT