public class TestString {
public static void main(String[] args) {
String s = "good morning EVERY ONE";
char[] c=s.toUpperCase().toCharArray();
for(int i=1;i<c.length;i++) {
if(c[i]!=' '&&c[i-1]!=' ') {
c[i]+=32;
}
}
s=new String(c);
System.out.println(s);
}
}