import java.io.*;

public class Ponctuation extends PushbackReader {
  private int dernierLu=-1;
  public Ponctuation (Reader fichier) {
    super(fichier,1);
  }
  public int read() throws IOException {
    int c=super.read();
    if ((",;:".indexOf(dernierLu)>=0) && (c!=' ')) {
      unread(c);
      c=' ';
    }
    if (c==' ') {
      int d=super.read();
      if (d!=',') unread(d);
      else c=',';
    }
    if (((c==';') || (c==':')) && (dernierLu!=' ')){
      unread(c);
      c=' ';      
    }
    dernierLu=c;
    return c;
  } 
  public int read(char[] cbuf , int off,int len) throws IOException {
    int c=0;
    for (int i=0;(i<len) && (c!=-1);i++) {
       c=read();
       cbuf[off++]=(char) c;
    }
    if (c!=-1) return len;
    else return -1;
  }        
}