#include <bits/stdc++.h>
using namespace std;
int l, tn = 0;
string t[111111], s;
int main() {
  getline(cin, s);
  l = s.length();
  for (int i = 0; i < l; i++) {
    if (s[i] == ',' || s[i] == '.' || s[i] == '?' || s[i] == '!') {
      t[tn++] = "-";
      t[tn - 1][0] = s[i];
    } else if (s[i] >= 'a' && s[i] <= 'z') {
      int r = i;
      while (s[r] >= 'a' && s[r] <= 'z' && r < l) r++;
      t[tn++] = s.substr(i, r - i);
      i = r - 1;
    }
  }
  int last = 0;
  for (int i = 0; i < tn; i++) {
    if (t[i][0] >= 'a') {
      if (last == 1) cout << " ";
      cout << t[i];
      last = 1;
    } else {
      cout << t[i] << " ";
      last = 0;
    }
  }
  cout << endl;
  return 0;
}
