import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final String input = sc.nextLine().replaceFirst("^[[:space:]]+", "").replaceFirst("^w+", ""); final Pattern pat = Pattern.compile("(([^w]+)(w+))"); //System.out.println(input + " " + pat); final Matcher mat = pat.matcher(input); LinkedList answer = new LinkedList(); int max_len = 0; while(mat.find()){ final String in = mat.group(2); final int w_len = mat.group(3).length(); if(max_len > w_len){ continue; } if(max_len < w_len){ max_len = w_len; answer.clear(); } answer.add(in); } if(answer.size() == 0){ System.out.println(); } else{ for(final String ans : answer){ System.out.println(ans); } } } }