package test; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Queue; import java.util.Scanner; import java.util.Vector; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); char s[] = str.toCharArray(); int max_n = 0,now = 0,st = 0; for(int i = 0;i < str.length();i++){ if(s[i] == 'w')st++; else break; } for(int i = st;i < str.length();i++){ if(s[i] == 'w'){ now++; }else{ max_n = Math.max(max_n, now); now = 0; } } max_n = Math.max(max_n,now); ArrayList list = new ArrayList(); String last = new String(); int how = 0; for(int i = st;i < str.length();i++){ if(s[i] == 'w'){ how++; }else{ if(how != 0){ if(how == max_n){ list.add(last); } how = 0; last = ""; } last += "" + s[i]; } } if(how == max_n && !last.equals("")){ list.add(last); } if(list.size() == 0 || max_n == 0){ System.out.println(""); }else{ for(int i = 0;i < list.size();i++){ System.out.println(list.get(i)); } } } }