#include <bits/stdc++.h>
using namespace std;
char s[10005], las = -1;
int len;
int main() {
  cin.getline(s, 10005);
  len = strlen(s);
  for (int i = (0); i <= (len - 1); i++) {
    if (s[i] >= 'a' && s[i] <= 'z') {
      if (las != -1) {
        if (las != 32) printf("%c", las);
        printf(" ");
      }
      printf("%c", s[i]);
      las = -1;
    } else {
      if (s[i] != 32)
        las = s[i];
      else if (las == -1)
        las = s[i];
    }
  }
  if (las != -1 && las != 32) printf("%c", las);
  printf("\n");
  return 0;
}
