import java.io.*;
import javagently.*;

class Spaces {

  /* Removing spaces program   by J M Bishop  Dec 1997
   * -----------------------   Java 1.1
   *
   * Replaces double spaces by single.
   * Illustrates use of string handling methods.
   */

  public static void main (String args []) throws IOException {
    System.out.println("Program to convert double spaces");
    System.out.println("to single ones.");
    Stream fin = new Stream (System.in);

    String s = "";
    int spaceAt, startingFrom;
    try {
      while (true) {
        s = fin.readLine();
        if (s==null) throw new EOFException();

        startingFrom = 0;
        while (true) {
        spaceAt = s.indexOf("  ",startingFrom);
          if (spaceAt==-1) break;
          else if (spaceAt==0)
               s = s.substring(1,s.length());
          else s = s.substring(0,spaceAt)+" "
                 + s.substring(spaceAt+2,s.length());
          startingFrom = spaceAt+2;
        }
        System.out.println(s);

      }
    }
    catch (EOFException e) {}
  }
}
