Processing math: 100%
String normalization - MarisaOJ: Marisa Online Judge

String normalization

Time limit: 1000 ms
Memory limit: 256 MB
Given a string S consisting of letters and spaces, perform string normalization as follows: - Remove leading and trailing spaces. - Remove any extra spaces between words. - Capitalize the first letter of each word and convert the rest of the letters to lowercase. Write a program that takes as input a string and outputs the normalized string. ### Input - A single line containing the string S. ### Output - Print the normalized string S. ### Constraints - 1≤|S|≤1000. ### Sample test AqUickBRownfOX Output: AQuickBrownF⊗