#include <bits/stdc++.h>
int check(char ch) {
  if (ch == ' ')
    return 1;
  else if (ch == '.' || ch == ',' || ch == '!' || ch == '?')
    return 2;
  else
    return 3;
}
using namespace std;
int main() {
  int i, n;
  string str, rstr;
  char ch;
  getline(cin, str);
  for (i = 0; i < str.size(); ++i) {
    ch = str[i];
    if (check(ch) == 3) {
      rstr += str[i];
    } else {
      if (check(ch) == 2) {
        rstr += ch;
        rstr += " ";
      } else {
        if (check(rstr.at(rstr.size() - 1)) != 1 && check(str[i + 1]) > 2) {
          rstr += " ";
        }
      }
    }
  }
  cout << rstr;
  return 0;
}
