#include <bits/stdc++.h>
void Remove_extra_space(char* original, char* new_str, int len);
void punc_space(char* original, char* new_str, int len);
void inser_space(char* original, char* new_str, int len);
int main(void) {
  char str[10001];
  int len, i, j;
  scanf("%[^\n]%*c", str);
  len = strlen(str);
  char new_str1[len + 1];
  inser_space(str, new_str1, len);
  len = strlen(new_str1);
  char new_str2[len + 1];
  Remove_extra_space(new_str1, new_str2, len);
  len = strlen(new_str2);
  char new_str3[len + 1];
  punc_space(new_str2, new_str3, len);
  printf("%s\n", new_str3);
  return 0;
}
void Remove_extra_space(char* original, char* new_str, int len) {
  int i, index = 0;
  for (i = 0; i < len; i++) {
    if (original[i] == ' ') {
      new_str[index] = original[i];
      index++;
      i++;
      while (original[i] == ' ') {
        i++;
      }
    }
    new_str[index] = original[i];
    index++;
  }
  new_str[index] = '\0';
}
void punc_space(char* original, char* new_str, int len) {
  int i, index = 0, j;
  for (i = 0; i < len; i++) {
    if (original[i] == ' ' &&
        (original[i + 1] == '.' || original[i + 1] == ',' ||
         original[i + 1] == '!' || original[i + 1] == '?')) {
      i++;
      new_str[index] = original[i];
      index++;
      i++;
    }
    new_str[index] = original[i];
    index++;
  }
  new_str[index] = '\0';
}
void inser_space(char* original, char* new_str, int len) {
  int i, index = 0;
  for (i = 0; i < len; i++) {
    if (original[i] == '.' || original[i] == ',' || original[i] == '!' ||
        original[i] == '?') {
      if (original[i + 1] != ' ') {
        new_str[index] = original[i];
        index++;
        new_str[index] = ' ';
        index++;
      } else if (original[i + 1] == ' ') {
        new_str[index] = original[i];
        index++;
      }
    } else {
      new_str[index] = original[i];
      index++;
    }
  }
  new_str[index] = '\0';
}
