import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main_yukicoder342 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int n = s.length(); List str = new ArrayList(); List len = new ArrayList(); int max = 0; int i = 0; while (i < n) { int j = s.indexOf('w', i); if (j == -1){ // str.add(s.substring(i, n)); // len.add(0); break; } else if (j == 0) { } else { str.add(s.substring(i, j)); i = j; } int tmp = 0; while (i < n && s.charAt(i) == 'w') { tmp++; i++; } len.add(tmp); max = Math.max(max, tmp); } if (str.size() == 0) { System.out.println(); } else if (str.size() == 1 && len.get(0) == n) { System.out.println(); } else { for (int j = 0; j < str.size(); j++) { if (len.get(j) == max && str.get(j).length() > 0) { System.out.println(str.get(j)); } } } sc.close(); } }