#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  cout.tie(0);
  string s, t = "";
  getline(cin, s);
  for (int i = 0; i < s.length(); i++) {
    if (isalpha(s[i]))
      t += s[i];
    else if ((s[i] == '.') || (s[i] == ',') || (s[i] == '?') || (s[i] == '!')) {
      t = t + s[i];
      if ((i < s.length() - 1) && (s[i + 1] != ' ')) t += " ";
    } else if ((i < s.length() - 1) && (isalpha(s[i + 1])))
      t += " ";
  }
  cout << t;
  return 0;
}
