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 JAVA (judge verdict: WA: Presentation Error)

import java.util.*;
import java.io.*;
 
class Main{
    public static void main(String args[])throws IOException{
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       String s;
       char c;
       while((s = br.readLine())!=null){
           //if(s)break;
           try{
               for(int i=0; i<s.length(); i++){
                   c = s.charAt(i);
                   if(c>=0x41 && c<=0x5a){
                       c += 0x20;
                   }else if(c>=0x61 && c<=0x7a){
                       c -= 0x20;
                   }
                   System.out.print(c);
                   
               }
           }catch(NumberFormatException e){
           }
       }
    }
}