#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string str;
  getline(cin, str);
  int n = str.size();
  int flag = 0;
  int lf = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == ' ') {
      flag = 1;
      continue;
    } else {
      if (str[i] >= 'a' && str[i] <= 'z') {
        if (flag && !lf) cout << ' ';
        cout << str[i];
        flag = 0;
        lf = 0;
      } else {
        cout << str[i] << ' ';
        lf = 1;
        flag = 0;
      }
    }
  }
  cout << endl;
  return 0;
}
