import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String s = sc.nextLine(); char c = 'w'; while(s.charAt(0) == c){ s = s.substring(1); } String maxans = ""; int maxgrass = 0; String ans = ""; int grass = 0; StringBuilder sb = new StringBuilder(); boolean inStr = true; // true - constructing string, false - counting w for(int i = 0; i < s.length(); i++){ if(inStr && s.charAt(i) != c){ sb.append(s.charAt(i)); }else if(inStr && s.charAt(i) == c){ ans = sb.toString(); sb.setLength(0); grass = 1; inStr = false; }else if(!inStr && s.charAt(i) == c){ grass++; }else if(!inStr && s.charAt(i) != c){ inStr = true; sb.setLength(0); sb.append(s.charAt(i)); if(grass > maxgrass){ maxans = ans; maxgrass = grass; }else if(grass == maxgrass){ maxans = maxans + "\n" + ans; } grass = 0; ans = ""; } } if(!inStr){ if(grass > maxgrass){ maxans = ans; }else if(grass == maxgrass){ maxans = maxans + "\n" + ans; } } System.out.print(maxans); } }