#include <bits/stdc++.h>
int main() {
  char s[10001], out[30001] = {0};
  scanf("%[^\n]s", &s);
  int l = strlen(s);
  int i = 1, j = 1;
  out[0] = s[0];
  while (s[i] != '\0') {
    if (s[i] == ' ') {
      if (out[j - 1] != ' ') {
        out[j] = ' ';
        j++;
      }
      i++;
    } else if (s[i] == ',' || s[i] == '.' || s[i] == '!' || s[i] == '?') {
      if (out[j - 1] == ' ') {
        out[j - 1] = s[i];
        i++;
        out[j] = ' ';
        j++;
      } else {
        out[j] = s[i];
        j++;
        i++;
        out[j] = ' ';
        j++;
      }
    } else {
      out[j] = s[i];
      j++;
      i++;
    }
  }
  out[j] = '\0';
  printf("%s", out);
  return 0;
}
