#include <bits/stdc++.h>
using namespace std;
string s, w;
int i, l;
bool f(char c) { return (c == '!' || c == '?' || c == '.' || c == ','); }
int main() {
  getline(cin, s);
  l = (int)s.size();
  w = "";
  for (i = 0; i <= (int)s.size() - 1; ++i)
    if (f(s[i]))
      w = w + s[i] + " ";
    else
      w += s[i];
  s = w;
  for (i = 0; i <= (int)s.size() - 1; ++i) {
    if (i == 0)
      cout << s[i];
    else if (s[i] == ' ') {
      if (s[i + 1] == ' ') continue;
      if (i < (int)s.size() - 1 && !f(s[i + 1])) cout << " ";
    } else if (s[i] >= 'a' && s[i] <= 'z')
      cout << s[i];
    else if (s[i] != ' ')
      cout << s[i] << "";
  }
  cout << endl;
}
