#include <bits/stdc++.h>
long long frq[100001];
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  string s, ss;
  long long x = 0, fl = 0;
  long long siz = s.size();
  getline(cin, s);
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != ' ' && s[i] != '.' && s[i] != ',' && s[i] != '!' &&
        s[i] != '?') {
      ss.push_back(s[i]);
      fl = 0;
    }
    if (s[i] == ' ' && fl == 0) {
      ss.push_back(' ');
      fl = 1;
    }
    if (s[i] == '.' || s[i] == ',' || s[i] == '!' || s[i] == '?') {
      if (s[i - 1] == ' ') {
        ss.pop_back();
      }
      ss.push_back(s[i]);
      ss.push_back(' ');
      fl = 1;
    }
  }
  cout << ss;
}
