import static java.lang.System.*; import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { String s = sc.nextLine(); s = s.replaceFirst("^w+",""); out.println(s); s = s.replaceAll("[^w]+$",""); out.println(s); List listA = new LinkedList(Arrays.asList(s.split("w+"))); List listB = new LinkedList(Arrays.asList(s.split("[^w]+",0))); listB.remove(0); int max = Integer.MIN_VALUE; for (int i=0; i max) { max = listB.get(i).length(); } } if (listA.size()==0) { out.println(""); return; } for (int i=0; i