import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] inputs = sc.next().toCharArray(); int max_length = 0; int start = 0; int length = 0; LinkedList answer = new LinkedList(); for(int i = 0; i < inputs.length; i++){ if(inputs[i] == 'w'){ length++; }else if(length != 0){ if(max_length < length){ answer.clear(); } //System.out.println(i); { StringBuilder sb = new StringBuilder(); for(int j = start; j < (i - length); j++){ sb.append(inputs[j]); } if(!sb.toString().equals("")){ answer.add(sb.toString()); } } max_length = length; start = i; length = 0; } } if(max_length != 0 && length != 0){ if(max_length < length){ answer.clear(); } StringBuilder sb = new StringBuilder(); for(int j = start; j < (inputs.length - length); j++){ sb.append(inputs[j]); } if(!sb.toString().equals("")){ answer.add(sb.toString()); } } if(answer.size() == 0){ System.out.println(); }else{ for(final String str : answer){ System.out.println(str); } } } }