#include <bits/stdc++.h>
using namespace std;
void solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  getline(cin, s);
  int n = s.length(), i, j;
  string t = "";
  for (i = 0; i < n; i++) {
    if (isalpha(s[i]) == false) {
      if (s[i] == ' ') {
        int d = t.length();
        if (t[d - 1] != ' ') {
          t += s[i];
        }
      } else {
        if (s[i - 1] == ' ') {
          int l = t.length();
          t[l - 1] = s[i];
          t += ' ';
        } else {
          t += s[i];
          t += ' ';
        }
      }
    } else {
      t += s[i];
    }
  }
  cout << t << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
