15.* Bits Exchange

using System;

class Bits
{
    static void Main()
    {
        uint number = uint.Parse(Console.ReadLine());
        Console.WriteLine(Convert.ToString(number, 2).PadLeft(32, '0'));

        int mask = 1 << 3;
        uint bit3 = (number & (uint)mask) >> 3;

        mask = 1 << 24;
        uint bit24 = (number & (uint)mask )>> 24;

        if (bit3 == 0)
        {
            //put 0 in 24th position
            mask = ~(1 << 24);
            number = number & (uint)mask;
        }
        else if (bit3 == 1)
        {
            //put 1 in 24th position
            mask = 1 << 24;
            number = number | (uint)mask;
        }
        if (bit24 == 0)
        {
            //put 0 in 3rd position
            mask = ~(1 << 3);
            number = number & (uint)mask;
        }
        else if (bit24 == 1)
        {
            //put 1 in 3rd position
            mask = 1 << 3;
            number = number | (uint)mask;
        }
        mask = 1 << 4;
        uint bit4 = (number & (uint)mask) >> 4;

        mask = 1 << 25;
        uint bit25 = (number & (uint)mask) >> 25;

        if (bit4 == 0)
        {
            //put 0 in 25th position
            mask = ~(1 << 25);
            number = number & (uint)mask;
        }
        else if (bit4 == 1)
        {
            //put 1 in 25th position
            mask = 1 << 25;
            number = number | (uint)mask;
        }
        if (bit25 == 0)
        {
            //put 0 in 4th position
            mask = ~(1 << 4);
            number = number & (uint)mask;
        }
        else if (bit25 == 1)
        {
            //put 1 in 4th position
            mask = 1 << 4;
            number = number | (uint)mask;
        }
        mask = 1 << 5;
        uint bit5 = (number & (uint)mask) >> 5;

        mask = 1 << 26;
        uint bit26 = (number & (uint)mask) >> 26;

        if (bit5 == 0)
        {
            //put 0 in 26th position
            mask = ~(1 << 26);
            number = number & (uint)mask;
        }
        else if (bit5 == 1)
        {
            //put 1 in 26th position
            mask = 1 << 26;
            number = number | (uint)mask;
        }
        if (bit26 == 0)
        {
            //put 0 in 5th position
            mask = ~(1 << 5);
            number = number & (uint)mask;
        }
        else if (bit26 == 1)
        {
            //put 1 in 5th position
            mask = 1 << 5;
            number = number | (uint)mask;
        }
        Console.WriteLine(Convert.ToString(number, 2).PadLeft(32, '0'));
        Console.WriteLine(number);
    }
}