import java.util.*;
import java.util.regex.*;


class rTest {
  public static void main (String[] args) {

    String s = "This is!just an:example,of a string,that needs?to be fixed.by inserting:a whitespace;after punctuation marks.";
    s = s.replaceAll("(?<=[,.!?;:])(?!$)", " ");
    System.out.println(s);


  }
}