#include <bits/stdc++.h>
using namespace std;
string fixPunct(string original) {
  string fixed = "";
  bool spaceInserted = false;
  int len = original.size();
  for (int ci = 0; ci < len; ci++) {
    char c = original.at(ci);
    if (isalpha(c)) {
      spaceInserted = false;
      fixed += c;
      continue;
    } else {
      if (ispunct(c)) {
        fixed += c;
        fixed += ' ';
        spaceInserted = true;
        continue;
      }
      switch (c) {
        case ' ':
          if (!spaceInserted) {
            for (int i = ci; i < original.size(); i++) {
              if (isalpha(original.at(i))) {
                fixed += ' ';
                ci = i - 1;
                spaceInserted = true;
                break;
              }
              if (ispunct(original.at(i))) {
                fixed += original.at(i);
                fixed += ' ';
                ci = i;
                spaceInserted = true;
                break;
              }
            }
            if (!spaceInserted) {
              fixed += ' ';
              spaceInserted = true;
            }
          }
          break;
        default:
          if (!spaceInserted) {
            fixed += c;
          }
      }
    }
  }
  return fixed;
}
int main() {
  string v1;
  std::getline(std::cin, v1);
  cout << fixPunct(v1) << endl;
  return 0;
}
