#include <bits/stdc++.h>
using namespace std;
const int MaxN = int(2e5);
const long double pi = 3.1415926535897932384626433832795;
char s[MaxN];
int main() {
  while (gets(s)) {
    int len = strlen(s);
    int l = 0;
    while (s[l] == 32) ++l;
    int r = len - 1;
    while (s[r] == 32) --r;
    if (l > r) {
      puts("");
      continue;
    }
    bool space = false;
    bool znak = false;
    for (int i = l; i <= r; i++) {
      if (isalpha(s[i])) {
        if (space && !znak)
          printf(" %c", s[i]);
        else
          printf("%c", s[i]);
        znak = false;
        space = false;
      }
      if (s[i] == '.' || s[i] == ',' || s[i] == '!' || s[i] == '?')
        printf("%c ", s[i]), znak = true;
      if (s[i] == 32) space = true;
    }
    puts("");
  }
  return 0;
}
