#include <bits/stdc++.h>
using namespace std;
int main() {
  string line;
  getline(cin, line);
  int L = line.size();
  bool first = true;
  for (int i = 0; i < L;) {
    if (line[i] == ' ')
      ++i;
    else if (line[i] == '.' || line[i] == ',' || line[i] == '!' ||
             line[i] == '?') {
      cout << line[i];
      ++i;
    } else {
      if (!first) cout << ' ';
      first = false;
      string s;
      int e = i;
      while (e < L && line[e] >= 'a' && line[e] <= 'z') {
        cout << line[e];
        ++e;
      }
      i = e;
    }
  }
  return 0;
}
