#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  string new_s = "";
  new_s = new_s + s[0];
  int lengtho = s.length(), si = 1, new_l = 1;
  char c1 = s[0], c2;
  int j = 0;
  lengtho -= 1;
  while (lengtho--) {
    c2 = s[si];
    si++;
    if (c2 == ' ' && c1 == ' ') continue;
    if (c1 == '.' || c1 == ',' || c1 == '!' || c1 == '?') {
      if (c2 != ' ') {
        new_s += " ";
        new_l++;
        c1 = ' ';
      }
    }
    if (c2 == '.' || c2 == ',' || c2 == '!' || c2 == '?') {
      if (c1 == ' ') {
        new_s.erase(new_l - 1, 1);
        new_l--;
      }
    }
    new_s = new_s + c2;
    new_l++;
    c1 = c2;
  }
  cout << new_s << endl;
}
