#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[10005];
  gets(s);
  for (int i = 0; s[i]; i++)
    if (s[i] != 32 || s[i + 1] > 96) {
      putchar(s[i]);
      if (s[i] > 32 && s[i] < 97) s[i--] = 32;
    }
}
