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 JavaScript (judge verdict: Accepted)

"use strict";

function Main(input) {
    var ans="";
    for(var i=0;i<input.length;i++){
        var temp=input.charAt(i);
        if(temp === temp.toLowerCase())
            ans+=temp.toUpperCase();
        else
            ans+=temp.toLowerCase();
    }
    console.log(ans.trim());
}
    
function debug(){
	var input = document.getElementById("input").value;
	Main(input);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));