public static void main(String args[]){
System.out.print("Input text: ");
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
String[] words = s.split("[^a-zA-Z']+");
for (int i = 0; i < words.length; i++) {
if (Character.isUpperCase(words[i].charAt(0))) {
System.out.println(words[i]);
}} }
}