#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9 + 7;
const int N = 3 * 1e5 + 7;
void solve() {
  string s, a;
  getline(cin, s);
  while (s[0] == ' ') {
    s.erase(0, 1);
  }
  for (int i = 0; i < (int)s.size(); i++) {
    if ((s[i] == s[i + 1] && s[i] == ' ')) continue;
    if (s[i] == ' ' && s[i + 1] < 'a' || s[i + 1] > 'z') continue;
    a += s[i];
  }
  for (int i = 0; i < (int)a.size(); i++) {
    if ((a[i] < 'a' || a[i] > 'z') && a[i] != ' ' && a[i + 1] != ' ')
      cout << a[i] << " ";
    else
      cout << a[i];
  }
}
int main() {
  int TEST = 1;
  while (TEST--) {
    solve();
    cout << '\n';
  }
}
