import java.util.regex.*;

class Ideone {
	public static void main (String[] args) throws java.lang.Exception {
		String s = "BByTTheWay";
		Pattern p = Pattern.compile("[A-Z][a-z]*");
		Matcher m = p.matcher(s);
		String r = "";
		while (m.find()) {
			r = r + m.group(0) + " ";
		}
		System.out.println(r + s);
	}
}