import java.io.*;
import java.util.Vector;
public class Paragraph {
  
  public static void main(String[] args) throws IOException {
    BufferedReader br=
     new BufferedReader(new InputStreamReader(System.in));
    Vector myParagraph= new Vector();
    String paragraphStopper= "stopParagraph";
    String sentenceStopper= "stopSentence";
    
    for (String input= br.readLine();
         !input.equals(paragraphStopper); input= br.readLine()) {
      Vector v= new Vector();
      while (!input.equals(sentenceStopper)) {
        v.add(input);
        input= br.readLine();
      }
      myParagraph.add(v);
    }
    
    for (int i= 0; i != myParagraph.size(); i++) {
      Vector v= (Vector) myParagraph.elementAt(i);
      for (int j= 0;
           j != ((Vector) myParagraph.elementAt(i)).size(); j++) {
        System.out.print(v.elementAt(j) + " ");
      }
      System.out.println("");
    }
                        
  }
}
      