package contest; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class B { static Scanner in; static PrintWriter out; static String INPUT = ""; static void solve() { char[] S = in.nextLine().toCharArray(); char w = 'w'; char[] T = null; for(int i = 0;i < S.length;i++){ if(S[i] != w){ T = Arrays.copyOfRange(S, i, S.length); break; } } if(T == null){ out.println(); return; } S = T; int max = 0; int ws = 0; List ends = new ArrayList<>(); for(int i = 0;i < S.length;i++){ char c = S[i]; if(c == w){ ws++; if(ws == max){ ends.add(i); }else if(ws > max){ max = ws; ends.clear(); ends.add(i); } }else{ ws = 0; } } if(ends.isEmpty()){ out.println(); }else{ for(int end : ends){ if(end-max == -1)continue; int start = end-max; while(start >= 0 && S[start] != w)start--; for(int i = start+1;i <= end-max;i++){ out.print(S[i]); } out.println(); } } } public static void main(String[] args) throws Exception { in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT); out = new PrintWriter(System.out); solve(); out.flush(); } static int ni() { return Integer.parseInt(in.next()); } static long nl() { return Long.parseLong(in.next()); } static double nd() { return Double.parseDouble(in.next()); } static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); } }