#include <bits/stdc++.h>
using namespace std;
vector<string> ans;
int main() {
  char c;
  string ss = "";
  while ((c = getchar()) != '\n') {
    if ('a' <= c && 'z' >= c) {
      ss += c;
      continue;
    } else if (c == ' ') {
      if (!ss.empty()) {
        ans.push_back(ss);
        ss = "";
      }
    } else {
      if (!ss.empty()) {
        ans.push_back(ss);
        ss = "";
      }
      ans[ans.size() - 1] += c;
    }
  }
  if (!ss.empty()) ans.push_back(ss);
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i];
    if (i == ans.size() - 1)
      cout << '\n';
    else
      cout << " ";
  }
  return 0;
}
