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)

#include<stdio.h>
void flip_al(char* x, char* y);
int main(void){
	char ch[1200];
	int i;
	char array[1200];
	
	while(1){
		scanf("%c",&ch);
		flip_al(ch,array);
		i = 0;
		while(array[i] != '\0'){
			printf("%c",array[i]);
			i++;
		}
		if(ch[i-1] == '\n')break;
	}
	return 0;
}

void flip_al(char* x, char* y){
	while(*x != '\0'){
		if(*x >= 'A' && *x <= 'Z'){
			*y = *x + ('a'- 'A');
		}else if(*x >= 'a' && *x <= 'z'){
			*y = *x - ('a' - 'A');
		}else{
			*y = *x;
		}
		x++;
		y++;
	}
	*y = *x;
	return;
}