#include <bits/stdc++.h>
using namespace std;
bool prep(char c) { return (c == ',' || c == '.' || c == '!' || c == '?'); }
int main() {
  char c;
  string s;
  string ans;
  char str[10041];
  fgets(str, 100000, stdin);
  s = string(str);
  string s1;
  s1.push_back(s[0]);
  for (int i = 1; i < s.size(); ++i)
    if (s[i - 1] != ' ' || s[i] != ' ') s1.push_back(s[i]);
  string s2;
  s2.push_back(s1[0]);
  for (int i = 1; i < s1.size(); ++i)
    if (s1[i - 1] == ' ' && prep(s1[i]))
      s2[s2.size() - 1] = s1[i];
    else
      s2.push_back(s1[i]);
  ans.push_back(s2[0]);
  for (int i = 1; i < s2.size(); ++i) {
    if (s2[i] != ' ' && prep(s2[i - 1])) ans.push_back(' ');
    ans.push_back(s2[i]);
  }
  while (ans[0] == ' ') ans.erase(ans.begin());
  cout << ans;
  return 0;
}
