#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  char temp;
  for (int i = 0; i < s.size(); i++) {
    if (s.find("  ") != string::npos) s.erase(s.find("  "), 1);
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ' ' && (s[i + 1] == ',' || s[i + 1] == '.' || s[i + 1] == '?' ||
                        s[i + 1] == '!'))
      swap(s[i], s[i + 1]);
    else if ((s[i] == ',' || s[i] == '.' || s[i] == '?' || s[i] == '!') &&
             (s[i + 1] >= 'a' && s[i + 1] <= 'z'))
      s.insert(i + 1, 1, ' ');
    if (s.find("  ") != string::npos) s.erase(s.find("  "), 1);
  }
  cout << s << endl;
  return 0;
}
