#include <bits/stdc++.h>
using namespace std;
char s[10010];
int main() {
  scanf("%[^\n]", s);
  int len = strlen(s);
  for (int i = 0; i < len; i++) {
    int ii = i;
    while (s[ii] == ' ') ii++;
    if (ii < len)
      if (s[ii] == '.' || s[ii] == ',' || s[ii] == '!' || s[ii] == '?') {
        printf("%c ", s[ii]);
        while (s[ii + 1] == ' ') ii++;
      } else {
        if (i < ii) printf(" ");
        printf("%c", s[ii]);
      }
    i = ii;
  }
  puts("");
  return 0;
}
