#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  char ss[10001];
  getline(cin >> ws, s);
  int m = s.size();
  int k = -1;
  for (int i = 0; i < m; i++) {
    if (s[i] >= 'a' && s[i] <= 'z') {
      ss[++k] = s[i];
    } else if (s[i] == ' ') {
      if (s[i + 1] >= 'a' && s[i + 1] <= 'z') {
        ss[++k] = s[i];
      }
    } else {
      ss[++k] = s[i];
      if (s[i + 1] != ' ') ss[++k] = ' ';
    }
  }
  for (int i = 0; i <= k; i++) {
    cout << ss[i];
  }
}
