#include <bits/stdc++.h>
using namespace std;
int main() {
  char buf[20000];
  cin.getline(buf, 20000);
  for (int i = 0; buf[i];) {
    if (buf[i] >= 'a' && buf[i] <= 'z') {
      cout << buf[i++];
    } else {
      while (buf[i] == ' ') {
        ++i;
        continue;
      }
      if (buf[i] < 'a' || buf[i] > 'z') {
        cout << buf[i];
        while (buf[++i] == ' ') continue;
      }
      cout << ' ';
    }
  }
  cout << endl;
  return 0;
}
