#include <bits/stdc++.h>
using namespace std;
char s[10005];
int main() {
  bool f = false;
  int i, r = 0;
  while (scanf("%s", &s) != EOF) {
    i = 0;
    if ((s[0] == '.' || s[0] == ',' || s[0] == '?' || s[0] == '!') &&
        strlen(s) > 1)
      printf("%c ", s[0]), i = 1;
    else if ((s[0] == '.' || s[0] == ',' || s[0] == '?' || s[0] == '!'))
      printf("%c", s[0]), i = 1;
    else if (r)
      printf(" ");
    for (; i < strlen(s); i++) {
      if ((s[i] == '.' || s[i] == ',' || s[i] == '?' || s[i] == '!') &&
          i < strlen(s) - 1)
        printf("%c", s[i]), printf(" ");
      else
        printf("%c", s[i]);
    }
    r++;
  }
  printf("\n");
  return 0;
}
