Problem:
Toggling Cases

Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.

Input

A string is given in a line.

Output

Print the converted string in a line. Note that you do not need to convert any characters other than alphabetical letters.

Constraints

The length of the input string < 1200

Sample Input

fAIR, LATER, OCCASIONALLY CLOUDY.

Sample Output

Fair, later, occasionally cloudy.

Solution in C# (judge verdict: Time Limit Exceeded)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication10
{
    //ONLINE JUDGE (ITP1_8_A)

    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                char ch = (char)Console.Read();

                if ((ch >= 'A') && (ch <= 'Z'))
                {
                    ch = char.ToLower(ch);
                    Console.Write(ch);
                }
                else if ((ch >= 'a')  && (ch <= 'z'))
                {
                    ch = char.ToUpper(ch);
                    Console.Write(ch);
                }
                else
                {
                    Console.Write(ch);
                }
            }
        }
    }
}