#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  int i, j;
  char c;
  vector<char> v;
  for (i = 0; i < s.size();) {
    if (s[i] == ' ') {
      for (j = i; j < s.size(); j++) {
        if (s[j] != ' ') {
          c = s[j];
          break;
        }
      }
      if (c == '.' || c == ',' || c == '?' || c == '!') {
        v.push_back(c);
        v.push_back(' ');
      } else {
        if (v[v.size() - 1] == ' ') {
          v.push_back(c);
        } else {
          v.push_back(' ');
          v.push_back(s[j]);
        }
      }
      i = j + 1;
    } else {
      c = s[i];
      if (c == '.' || c == ',' || c == '?' || c == '!') {
        v.push_back(s[i]);
        v.push_back(' ');
      } else
        v.push_back(s[i]);
      i++;
    }
  }
  for (i = 0; i < v.size(); i++) cout << v[i];
  cout << endl;
}
