#include <bits/stdc++.h>
template <typename T>
using vector = std::vector<T>;
using std::cin;
using std::cout;
int main() {
  std::ios_base::sync_with_stdio(0);
  std::cin.tie(0), std::cout.tie(0);
  std::string str;
  vector<std::string> arr;
  while (cin >> str) arr.push_back(str);
  {
    vector<std::string> temp;
    for (int i = 0; i < arr.size(); ++i) {
      std::string& s = arr[i];
      int l = 0;
      for (int k = 0; k < s.size(); ++k) {
        if (ispunct(s[k])) {
          if (l != k) temp.push_back(s.substr(l, k - l));
          temp.push_back(std::string(1, s[k]));
          l = k + 1;
        }
      }
      if (l != s.size()) {
        temp.push_back(l ? s.substr(l, s.size() - l) : s);
      }
    }
    std::swap(arr, temp);
  };
  for (int i = 0; i < arr.size(); ++i) {
    if (i && !ispunct(arr[i][0])) putchar(' ');
    printf("%s", arr[i].data());
  }
  puts("");
  return true & false;
}
